Renamed Header elements to ListHeader. Removed hungarian notation from ScreenMapControllers.
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
-- This is the example for how to theme ScreenMapControllers, the Config
|
||||
-- Key/Joy Mappings screen.
|
||||
|
||||
-- The contents of this file will actually be in several sections, each
|
||||
-- intended to be placed in its own file.
|
||||
-- Sections will be seperated by lines of dashes to make the separation clear.
|
||||
-- The first line inside the dashes will have the name of the file to copy the
|
||||
-- section to.
|
||||
-- The rest of the area inside the dashes will discuss general aspects of the
|
||||
-- section being discussed.
|
||||
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- metrics.ini - the metrics you might want to set
|
||||
-- See the ScreenMapControllers section of _fallback/metrics.ini
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- overlay, underlay, decorations, transitions
|
||||
-- ScreenMapControllers supports the standard layers and transitions:
|
||||
-- Layers: overlay, underlay, decorations
|
||||
-- Transitions: in, out, cancel
|
||||
-- Details of creating the layers and transitions for a screen are covered in
|
||||
-- ScreenWithLayersAndTransitions.lua.
|
||||
-- Previous versions of ScreenMapControllers had the warning in the overlay.
|
||||
-- The warning has been moved to Graphics/ScreenMapControllers warning.lua. If
|
||||
-- you have previously made a theme, update your theme to match the new
|
||||
-- convention.
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers warning.lua
|
||||
-- The warning that is displayed when entering the screen.
|
||||
-- The _fallback warning uses the WarningHeader and WarningText strings from
|
||||
-- en.ini. If all you want to do is change the text, add those entries to your
|
||||
-- en.ini.
|
||||
-- The actor returned by your lua file must handle TweenOn and TweenOff commands.
|
||||
-- TweenOn will occur when the screen starts.
|
||||
-- TweenOff will occur when the warning is dismissed.
|
||||
-- Here is a simple actor that dims the screen and displays the text.
|
||||
----------------------------------------------------------------
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(xy, SCREEN_CENTER_X, SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
TweenOnCommand=cmd(zoomto, SCREEN_WIDTH, SCREEN_HEIGHT; diffuse, Color.Black),
|
||||
TweenOffCommand=cmd(linear, 0.5; diffusealpha, 0),
|
||||
},
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningHeader"),
|
||||
TweenOnCommand=cmd(y,-80;diffuse,Color.Red),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
|
||||
},
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("WarningText"),
|
||||
TweenOnCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48),
|
||||
TweenOffCommand=cmd(linear,0.5;diffusealpha,0),
|
||||
},
|
||||
}
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers action.lua
|
||||
-- The fallback actor that is used when there isn't a specific actor for an
|
||||
-- action. At a minimum, this should display the name of the action, in order
|
||||
-- to correctly handle the possibility of actions being added in the future.
|
||||
-- _fallback's version accomplishes this by being a BitmapText and fetching the
|
||||
-- text from en.ini.
|
||||
----------------------------------------------------------------
|
||||
return Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
InitCommand= cmd(x, SCREEN_CENTER_X; zoom, .75; diffuse, color("#808080")),
|
||||
OnCommand= function(self)
|
||||
self:diffusealpha(0)
|
||||
self:decelerate(0.5)
|
||||
self:diffusealpha(1)
|
||||
-- This code is in the OnCommand because the screen sets the name of this
|
||||
-- actor after loading it. If this code was in the InitCommand, it would
|
||||
-- not work because the name is blank at that point.
|
||||
-- fancy effect: Look at the name (which is set by the screen) to set text
|
||||
-- The name is concatenated with "Action" so that the strings used will be
|
||||
-- unique, next to each other in the language file, and clear in usage.
|
||||
self:settext(
|
||||
THEME:GetString("ScreenMapControllers", "Action" .. self:GetName()))
|
||||
end,
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"),
|
||||
HideCommand=cmd(visible,false),
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")),
|
||||
LoseFocusCommand=cmd(stopeffect),
|
||||
}
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers <action name>.lua
|
||||
-- Every action can have its own special actor which will be used if it exists.
|
||||
-- Replace "<action name>" with the lowercase name of the action you are making
|
||||
-- an actor for and create the actor you want for that action.
|
||||
-- As of this writing, action names are:
|
||||
-- "clear", "reload", "save", "setlist", "exit"
|
||||
-- Creating actors is discussed in Examples/anatomy_of_an_actor.lua, so an
|
||||
-- example is not provided here.
|
||||
----------------------------------------------------------------
|
||||
|
||||
----------------------------------------------------------------
|
||||
-- Graphics/ScreenMapControllers nosetlistprompt.lua
|
||||
-- This is the actor that is displayed when the player attempts to use the
|
||||
-- SetList (or "Assign List") action without anything in the list.
|
||||
-- It should tell the player that the list is empty and how to add things to
|
||||
-- the list.
|
||||
-- It must handle TweenOn and TweenOff commands.
|
||||
-- TweenOn occurs when the player tries to perform the action and fails.
|
||||
-- TweenOff occurs when the prompt is dismissed.
|
||||
-- _fallback's does this by dimming the screen with a quad and using a
|
||||
-- BitmapText to display the string from the language file.
|
||||
-- Note the use of stoptweening in TweenOn and TweenOff. This is to prevent
|
||||
-- the player from overflowing the tween stack by mashing.
|
||||
----------------------------------------------------------------
|
||||
return Def.ActorFrame{
|
||||
InitCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y),
|
||||
Def.Quad{
|
||||
InitCommand=cmd(zoomto,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,Color.Black;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,1;linear,0.5;diffusealpha,0.8),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
Def.ActorFrame{
|
||||
Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
Text=ScreenString("NoSetListPrompt"),
|
||||
InitCommand=cmd(y,10;wrapwidthpixels,SCREEN_WIDTH-48;diffusealpha,0),
|
||||
TweenOnCommand=cmd(stoptweening;diffusealpha,0;sleep,0.5125;linear,0.125;diffusealpha,1),
|
||||
TweenOffCommand=cmd(stoptweening;linear,0.5;diffusealpha,0),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
return LoadFont("Common Normal") .. {
|
||||
InitCommand= cmd(x, SCREEN_CENTER_X; zoom, .75; shadowlength, 0; diffuse, color("#808080")),
|
||||
return Def.BitmapText{
|
||||
Font="Common Normal",
|
||||
InitCommand= cmd(x, SCREEN_CENTER_X; zoom, .75, 0; diffuse, color("#808080")),
|
||||
OnCommand= function(self)
|
||||
self:diffusealpha(0)
|
||||
self:decelerate(0.5)
|
||||
@@ -8,9 +9,8 @@ return LoadFont("Common Normal") .. {
|
||||
self:settext(
|
||||
THEME:GetString("ScreenMapControllers", "Action" .. self:GetName()))
|
||||
end,
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide");
|
||||
HideCommand=cmd(visible,false);
|
||||
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF"));
|
||||
LoseFocusCommand=cmd(stopeffect);
|
||||
};
|
||||
OffCommand=cmd(stoptweening;accelerate,0.3;diffusealpha,0;queuecommand,"Hide"),
|
||||
HideCommand=cmd(visible,false),
|
||||
GainFocusCommand=cmd(diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")),
|
||||
LoseFocusCommand=cmd(stopeffect),
|
||||
}
|
||||
|
||||
@@ -2855,60 +2855,82 @@ Fallback="ScreenOptionsServiceChild"
|
||||
NextScreen="ScreenOptionsService"
|
||||
HelpText=Screen.String("HelpTextMapControllers")
|
||||
#
|
||||
# This locks the input when the screen starts.
|
||||
LockInputSecs=2.5
|
||||
# The warning cannot be dismissed until this time expires.
|
||||
# This is additional time after LockInputSecs expires before the warning
|
||||
# will be sent the TweenOff command.
|
||||
AutoDismissWarningSecs=2.5
|
||||
# This is the number of lines that are visible on screen. Set this if you
|
||||
# have a footer that covers up the bottom area of the screen. The purpose
|
||||
# is to have the settings visible on screen even when the player's cursor is
|
||||
# on the exit choice.
|
||||
LinesVisible=16
|
||||
# This sets how long the NoSetListPrompt will show before being sent TweenOff.
|
||||
AutoDismissNoSetListPromptSecs=5
|
||||
#
|
||||
# The position of the Devices list and its On/Off commands.
|
||||
DevicesX=SCREEN_CENTER_X
|
||||
DevicesY=SCREEN_TOP+24
|
||||
DevicesOnCommand=zoom,0.75;draworder,5;strokecolor,color("0,0,0,1")
|
||||
DevicesOffCommand=
|
||||
#
|
||||
HeaderP1S1Command=x,SCREEN_CENTER_X-270
|
||||
HeaderP1S2Command=x,SCREEN_CENTER_X-195
|
||||
HeaderP1S3Command=x,SCREEN_CENTER_X-120
|
||||
HeaderP2S1Command=x,SCREEN_CENTER_X+120
|
||||
HeaderP2S2Command=x,SCREEN_CENTER_X+195
|
||||
HeaderP2S3Command=x,SCREEN_CENTER_X+270
|
||||
#
|
||||
headerCenterOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,1;ztest,true
|
||||
HeaderOnCommand=diffuse,color("#808080");shadowlength,0;zoom,0.75;maxwidth,130;
|
||||
HeaderGainFocusCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
HeaderLoseFocusCommand=diffuse,color("#808080");stopeffect
|
||||
# The ListHeader parts are the row that the player's cursor starts on with
|
||||
# the names of the columns.
|
||||
ListHeaderP1S1Command=x,SCREEN_CENTER_X-270
|
||||
ListHeaderP1S2Command=x,SCREEN_CENTER_X-195
|
||||
ListHeaderP1S3Command=x,SCREEN_CENTER_X-120
|
||||
ListHeaderP2S1Command=x,SCREEN_CENTER_X+120
|
||||
ListHeaderP2S2Command=x,SCREEN_CENTER_X+195
|
||||
ListHeaderP2S3Command=x,SCREEN_CENTER_X+270
|
||||
# ListHeaderCenterOnCommand is for the center element of the ListHeader.
|
||||
ListHeaderCenterOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,1;ztest,true
|
||||
# These commands are shared by all the ListHeader parts.
|
||||
ListHeaderOnCommand=diffuse,color("#808080");shadowlength,0;zoom,0.75;maxwidth,130;
|
||||
ListHeaderGainFocusCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
ListHeaderLoseFocusCommand=diffuse,color("#808080");stopeffect
|
||||
#
|
||||
# You want to leave the list of buttons to map so that all buttons for the
|
||||
# current game type will be mappable.
|
||||
ButtonsToMap=""
|
||||
#
|
||||
# The positions of the elements showing what is mapped.
|
||||
MappedToP1S1Command=x,SCREEN_CENTER_X-270
|
||||
MappedToP1S2Command=x,SCREEN_CENTER_X-195
|
||||
MappedToP1S3Command=x,SCREEN_CENTER_X-120
|
||||
MappedToP2S1Command=x,SCREEN_CENTER_X+120
|
||||
MappedToP2S2Command=x,SCREEN_CENTER_X+195
|
||||
MappedToP2S3Command=x,SCREEN_CENTER_X+270
|
||||
#
|
||||
# These commands are shared between all the elements.
|
||||
MappedToOnCommand=diffuse,color("#808080");shadowlength,0;zoom,0.75;maxwidth,130
|
||||
# WaitingCommand is executed when the player hits enter to set a key.
|
||||
MappedToWaitingCommand=diffuse,color("#FF8080");pulse;effectperiod,0.5;effectmagnitude,0.8,1.3,0
|
||||
# MappedInputCommand is executed after the player maps the key.
|
||||
MappedToMappedInputCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
MappedToGainFocusCommand=diffuse,color("#808080");diffuseshift;effectcolor2,color("#808080");effectcolor1,color("#FFFFFF")
|
||||
MappedToLoseFocusCommand=diffuse,color("#808080");stopeffect
|
||||
# GainMarkCommand is executed when the player adds the element to the set list.
|
||||
MappedToGainMarkCommand=textglowmode,'TextGlowMode_Inner';glow,color("#FF00007f")
|
||||
# LoseMarkCommand is executed when the player removes the element from the set list.
|
||||
MappedToLoseMarkCommand=textglowmode,'TextGlowMode_Inner';glow,color("#FF000000")
|
||||
#
|
||||
# The LineScroller is an ActorScroller that controls the positioning of the
|
||||
# rows.
|
||||
LineScrollerOnCommand=%function(self) self:draworder(-1); self:y(64) self:setsecondsperitem(0.1) self:SetTransformFromHeight(24) end
|
||||
LineScrollerOffCommand=
|
||||
LineHideCommand=visible,false
|
||||
LineOnCommand=%function(self) self:y(0); self:visible(true); local LeftToRight = math.mod(self.ItemIndex, 2) == 0 and 1 or -1; self:addx(-SCREEN_WIDTH * LeftToRight); end
|
||||
LineOffCommand=%function(self) local LeftToRight = math.mod(self.ItemIndex, 2) == 0 and 1 or -1; self:stoptweening() self:accelerate(0.3); self:addx(SCREEN_WIDTH * LeftToRight); self:queuecommand('Hide') end
|
||||
#
|
||||
ErrorX=SCREEN_CENTER_X
|
||||
ErrorY=SCREEN_CENTER_Y
|
||||
ErrorOnCommand=diffuse,color("#00FF00");zoom,0.8
|
||||
# The "P1 slots" and "P2 slots" labels. Use the entries in en.ini to change text.
|
||||
LabelP1OnCommand=x,SCREEN_CENTER_X*0.4;zoom,0.7;shadowlength,1
|
||||
LabelP1OffCommand=linear,0.5;diffusealpha,0
|
||||
LabelP2OnCommand=x,SCREEN_CENTER_X*1.6;zoom,0.7;shadowlength,1
|
||||
LabelP2OffCommand=linear,0.5;diffusealpha,0
|
||||
# The primary effect of keys on this row.
|
||||
PrimaryOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,1;ztest,true
|
||||
# The secondary effect of keys on this row.
|
||||
SecondaryOnCommand=x,SCREEN_CENTER_X;y,6;zoom,0.5;shadowlength,1;ztest,true
|
||||
ShowExitRow=true
|
||||
|
||||
[ScreenTestInput]
|
||||
Class="ScreenTestInput"
|
||||
|
||||
@@ -102,22 +102,21 @@ void ScreenMapControllers::Init()
|
||||
// header row
|
||||
{
|
||||
m_Line.push_back(new ActorFrame);
|
||||
m_headerCenter.LoadFromFont(THEME->GetPathF(m_sName, "title"));
|
||||
m_headerCenter.SetName("headerCenter");
|
||||
m_headerCenter.SetText(KEYNAME);
|
||||
ActorUtil::LoadAllCommands(m_headerCenter, m_sName);
|
||||
m_Line.back()->AddChild(&m_headerCenter);
|
||||
m_ListHeaderCenter.LoadFromFont(THEME->GetPathF(m_sName, "title"));
|
||||
m_ListHeaderCenter.SetName("ListHeaderCenter");
|
||||
m_ListHeaderCenter.SetText(KEYNAME);
|
||||
ActorUtil::LoadAllCommands(m_ListHeaderCenter, m_sName);
|
||||
m_Line.back()->AddChild(&m_ListHeaderCenter);
|
||||
FOREACH_ENUM(GameController, c)
|
||||
{
|
||||
for(int s= 0; s < NUM_SHOWN_GAME_TO_DEVICE_SLOTS; ++s)
|
||||
{
|
||||
BitmapText& text= m_headerLabels[c][s];
|
||||
BitmapText& text= m_ListHeaderLabels[c][s];
|
||||
text.LoadFromFont(THEME->GetPathF(m_sName, "title"));
|
||||
PlayerNumber pn = (PlayerNumber)c;
|
||||
text.SetName("Header");
|
||||
text.SetName("ListHeader");
|
||||
text.SetText(SLOT_NAMES[s]);
|
||||
text.RunCommands(THEME->GetMetricA(
|
||||
m_sName, ssprintf("HeaderP%iS%iCommand", c+1, s+1)));
|
||||
m_sName, ssprintf("ListHeaderP%iS%iCommand", c+1, s+1)));
|
||||
ActorUtil::LoadAllCommands(text, m_sName);
|
||||
m_Line.back()->AddChild(&text);
|
||||
}
|
||||
@@ -201,18 +200,18 @@ void ScreenMapControllers::Init()
|
||||
m_NoSetListPrompt->SetName("NoSetListPrompt");
|
||||
this->AddChild(m_NoSetListPrompt);
|
||||
|
||||
m_sprWarning.Load(THEME->GetPathG(m_sName, "warning"));
|
||||
m_sprWarning->SetName("Warning");
|
||||
m_sprWarning->SetDrawOrder(DRAW_ORDER_TRANSITIONS);
|
||||
this->AddChild(m_sprWarning);
|
||||
LOAD_ALL_COMMANDS(m_sprWarning);
|
||||
m_Warning.Load(THEME->GetPathG(m_sName, "warning"));
|
||||
m_Warning->SetName("Warning");
|
||||
m_Warning->SetDrawOrder(DRAW_ORDER_TRANSITIONS);
|
||||
this->AddChild(m_Warning);
|
||||
LOAD_ALL_COMMANDS(m_Warning);
|
||||
}
|
||||
|
||||
void ScreenMapControllers::BeginScreen()
|
||||
{
|
||||
m_iCurController = 0;
|
||||
m_iCurButton = 0;
|
||||
m_iCurSlot = 0;
|
||||
m_CurController = 0;
|
||||
m_CurButton = 0;
|
||||
m_CurSlot = 0;
|
||||
|
||||
ScreenWithMenuElements::BeginScreen();
|
||||
|
||||
@@ -223,7 +222,7 @@ void ScreenMapControllers::BeginScreen()
|
||||
m_fLockInputSecs= THEME->GetMetricF(m_sName, "LockInputSecs");
|
||||
m_AutoDismissWarningSecs= THEME->GetMetricF(m_sName, "AutoDismissWarningSecs");
|
||||
m_AutoDismissNoSetListPromptSecs= 0.0f;
|
||||
m_sprWarning->PlayCommand("TweenOn");
|
||||
m_Warning->PlayCommand("TweenOn");
|
||||
}
|
||||
|
||||
|
||||
@@ -263,13 +262,13 @@ void ScreenMapControllers::Update( float fDeltaTime )
|
||||
ASSERT(CursorOnKey());
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
|
||||
GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton );
|
||||
GameInput curGameI( (GameController)m_CurController, pKey->m_GameButton );
|
||||
|
||||
INPUTMAPPER->SetInputMap( m_DeviceIToMap, curGameI, m_iCurSlot );
|
||||
INPUTMAPPER->SetInputMap( m_DeviceIToMap, curGameI, m_CurSlot );
|
||||
INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
m_ChangeOccurred= true;
|
||||
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
pText->PlayCommand("MappedInput");
|
||||
if(m_InSetListMode)
|
||||
{
|
||||
@@ -419,8 +418,8 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
}
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
GameInput curGameI( (GameController)m_iCurController, pKey->m_GameButton );
|
||||
if( !INPUTMAPPER->ClearFromInputMap(curGameI, m_iCurSlot) )
|
||||
GameInput curGameI( (GameController)m_CurController, pKey->m_GameButton );
|
||||
if( !INPUTMAPPER->ClearFromInputMap(curGameI, m_CurSlot) )
|
||||
break;
|
||||
|
||||
INPUTMAPPER->AddDefaultMappingsForCurrentGameIfUnmapped();
|
||||
@@ -434,16 +433,16 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
{
|
||||
break;
|
||||
}
|
||||
if( m_iCurSlot == 0 && m_iCurController == 0 )
|
||||
if( m_CurSlot == 0 && m_CurController == 0 )
|
||||
{
|
||||
break; // can't go left any more
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurSlot--;
|
||||
if( m_iCurSlot < 0 )
|
||||
m_CurSlot--;
|
||||
if( m_CurSlot < 0 )
|
||||
{
|
||||
m_iCurSlot = NUM_CHANGABLE_SLOTS-1;
|
||||
m_iCurController--;
|
||||
m_CurSlot = NUM_CHANGABLE_SLOTS-1;
|
||||
m_CurController--;
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
@@ -454,16 +453,16 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
{
|
||||
break;
|
||||
}
|
||||
if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == NUM_GameController-1 )
|
||||
if( m_CurSlot == NUM_CHANGABLE_SLOTS-1 && m_CurController == NUM_GameController-1 )
|
||||
{
|
||||
break; // can't go right any more
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurSlot++;
|
||||
if( m_iCurSlot > NUM_CHANGABLE_SLOTS-1 )
|
||||
m_CurSlot++;
|
||||
if( m_CurSlot > NUM_CHANGABLE_SLOTS-1 )
|
||||
{
|
||||
m_iCurSlot = 0;
|
||||
m_iCurController++;
|
||||
m_CurSlot = 0;
|
||||
m_CurController++;
|
||||
}
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
@@ -475,7 +474,7 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
break;
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurButton--;
|
||||
m_CurButton--;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
@@ -486,7 +485,7 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
break;
|
||||
}
|
||||
BeforeChangeFocus();
|
||||
m_iCurButton++;
|
||||
m_CurButton++;
|
||||
AfterChangeFocus();
|
||||
m_soundChange.Play();
|
||||
bHandled = true;
|
||||
@@ -498,7 +497,7 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
case KEY_Cm:
|
||||
if(CursorOnKey())
|
||||
{
|
||||
SetListEntry to_add(SetListEntry(CurKeyIndex(), m_iCurController, m_iCurSlot));
|
||||
SetListEntry to_add(SetListEntry(CurKeyIndex(), m_CurController, m_CurSlot));
|
||||
set<SetListEntry>::iterator found= m_SetList.find(to_add);
|
||||
if(found == m_SetList.end())
|
||||
{
|
||||
@@ -535,7 +534,7 @@ bool ScreenMapControllers::Input( const InputEventPlus &input )
|
||||
|
||||
// This trace is also useless log spew. Create a preference or something
|
||||
// configurable if you disagree. -Kyz
|
||||
// LOG->Trace( "m_iCurSlot: %d m_iCurController: %d m_iCurButton: %d", m_iCurSlot, m_iCurController, m_iCurButton );
|
||||
// LOG->Trace( "m_CurSlot: %d m_CurController: %d m_CurButton: %d", m_CurSlot, m_CurController, m_CurButton );
|
||||
|
||||
Refresh();
|
||||
return bHandled;
|
||||
@@ -549,11 +548,11 @@ Actor *ScreenMapControllers::GetActorWithFocus()
|
||||
}
|
||||
if(CursorOnHeader())
|
||||
{
|
||||
return &(m_headerLabels[m_iCurController][m_iCurSlot]);
|
||||
return &(m_ListHeaderLabels[m_CurController][m_CurSlot]);
|
||||
}
|
||||
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
return pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
return pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
}
|
||||
|
||||
void ScreenMapControllers::BeforeChangeFocus()
|
||||
@@ -589,26 +588,26 @@ void ScreenMapControllers::Refresh()
|
||||
}
|
||||
|
||||
m_LineScroller.SetDestinationItem(
|
||||
static_cast<float>(min(m_iCurButton, m_MaxDestItem)));
|
||||
static_cast<float>(min(m_CurButton, m_MaxDestItem)));
|
||||
}
|
||||
|
||||
void ScreenMapControllers::DismissWarning()
|
||||
{
|
||||
m_sprWarning->PlayCommand("TweenOff");
|
||||
m_Warning->PlayCommand("TweenOff");
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnAction()
|
||||
{
|
||||
// We have a header row, the rows for the keys, and the action rows.
|
||||
// So every row after m_KeysToMap.size is an action row.
|
||||
return m_iCurButton >= static_cast<int>(m_KeysToMap.size()+1);
|
||||
return m_CurButton >= m_KeysToMap.size()+1;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnHeader()
|
||||
{
|
||||
// We have a header row before all others.
|
||||
// So the header is at 0.
|
||||
return m_iCurButton == 0;
|
||||
return m_CurButton == 0;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorOnKey()
|
||||
@@ -618,37 +617,37 @@ bool ScreenMapControllers::CursorOnKey()
|
||||
|
||||
bool ScreenMapControllers::CursorCanGoUp()
|
||||
{
|
||||
return m_iCurButton > 0;
|
||||
return m_CurButton > 0;
|
||||
}
|
||||
|
||||
bool ScreenMapControllers::CursorCanGoDown()
|
||||
{
|
||||
return m_iCurButton < m_KeysToMap.size() + m_Actions.size();
|
||||
return m_CurButton < m_KeysToMap.size() + m_Actions.size();
|
||||
}
|
||||
|
||||
int ScreenMapControllers::CurKeyIndex()
|
||||
{
|
||||
// The header row is at 0, so subtract 1 from m_iCurButton.
|
||||
return m_iCurButton - 1;
|
||||
// The header row is at 0, so subtract 1 from m_CurButton.
|
||||
return m_CurButton - 1;
|
||||
}
|
||||
|
||||
int ScreenMapControllers::CurActionIndex()
|
||||
{
|
||||
// Subtract the header row and the keys.
|
||||
return m_iCurButton - 1 - m_KeysToMap.size();
|
||||
return m_CurButton - 1 - m_KeysToMap.size();
|
||||
}
|
||||
|
||||
void ScreenMapControllers::SetCursorFromSetListCurrent()
|
||||
{
|
||||
m_iCurButton= m_SetListCurrent->m_button + 1;
|
||||
m_iCurController= m_SetListCurrent->m_controller;
|
||||
m_iCurSlot= m_SetListCurrent->m_slot;
|
||||
m_CurButton= m_SetListCurrent->m_button + 1;
|
||||
m_CurController= m_SetListCurrent->m_controller;
|
||||
m_CurSlot= m_SetListCurrent->m_slot;
|
||||
}
|
||||
|
||||
void ScreenMapControllers::StartWaitingForPress()
|
||||
{
|
||||
const KeyToMap *pKey = &m_KeysToMap[CurKeyIndex()];
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_iCurController][m_iCurSlot];
|
||||
BitmapText *pText = pKey->m_textMappedTo[m_CurController][m_CurSlot];
|
||||
pText->PlayCommand( "Waiting" );
|
||||
m_WaitingForPress.Touch();
|
||||
m_DeviceIToMap.MakeInvalid();
|
||||
@@ -663,12 +662,10 @@ void ScreenMapControllers::HandleScreenMessage(const ScreenMessage SM)
|
||||
DEFAULT_FAIL(ScreenPrompt::s_LastAnswer);
|
||||
case ANSWER_YES:
|
||||
SaveToDisk();
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen(SM_GoToNextScreen);
|
||||
break;
|
||||
case ANSWER_NO:
|
||||
ReloadFromDisk();
|
||||
SCREENMAN->PlayStartSound();
|
||||
StartTransitioningScreen(SM_GoToNextScreen);
|
||||
break;
|
||||
case ANSWER_CANCEL:
|
||||
|
||||
@@ -39,10 +39,10 @@ private:
|
||||
void SetCursorFromSetListCurrent();
|
||||
void StartWaitingForPress();
|
||||
|
||||
int m_iCurController;
|
||||
int m_iCurButton;
|
||||
int m_iCurSlot;
|
||||
int m_MaxDestItem;
|
||||
unsigned int m_CurController;
|
||||
unsigned int m_CurButton;
|
||||
unsigned int m_CurSlot;
|
||||
unsigned int m_MaxDestItem;
|
||||
|
||||
bool m_ChangeOccurred;
|
||||
|
||||
@@ -61,11 +61,11 @@ private:
|
||||
BitmapText m_textDevices;
|
||||
|
||||
BitmapText m_textLabel[NUM_GameController];
|
||||
BitmapText m_headerCenter;
|
||||
BitmapText m_headerLabels[NUM_GameController][NUM_SHOWN_GAME_TO_DEVICE_SLOTS];
|
||||
BitmapText m_ListHeaderCenter;
|
||||
BitmapText m_ListHeaderLabels[NUM_GameController][NUM_SHOWN_GAME_TO_DEVICE_SLOTS];
|
||||
|
||||
float m_AutoDismissWarningSecs;
|
||||
AutoActor m_sprWarning;
|
||||
AutoActor m_Warning;
|
||||
|
||||
float m_AutoDismissNoSetListPromptSecs;
|
||||
AutoActor m_NoSetListPrompt;
|
||||
|
||||
Reference in New Issue
Block a user