add labels for P1's and P2's groups of slots

This commit is contained in:
Chris Danford
2006-01-25 23:49:55 +00:00
parent 9d27c61ff9
commit c82073a40c
4 changed files with 60 additions and 22 deletions
@@ -1033,6 +1033,7 @@ HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::
[ScreenMapControllers]
HelpText=Use arrow keys to navigate, ENTER to assign, SPACE to clear, ESCAPE when done.
InvalidButton=That key can not be mapped.
%s slots=%s slots
[ScreenMiniMenu]
HelpText=
@@ -1465,3 +1466,7 @@ Finish >=Finish >
Cancel=Cancel
< Back=< Back
Install a package=Install a package
[PlayerNumber]
P1=P1
P2=P2
+8 -4
View File
@@ -2584,7 +2584,11 @@ LineOffCommand=%function(self) local LeftToRight = math.mod(self.ItemIndex, 2) =
ErrorX=SCREEN_CENTER_X
ErrorY=SCREEN_CENTER_Y
ErrorOnCommand=diffuse,#00FF00;zoom,0.8
TitleOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,2
LabelP1OnCommand=x,SCREEN_CENTER_X-195;zoom,0.7;shadowlength,2;diffusealpha,0;linear,0.5;diffusealpha,1
LabelP1OffCommand=linear,0.5;diffusealpha,0
LabelP2OnCommand=x,SCREEN_CENTER_X+195;zoom,0.7;shadowlength,2;diffusealpha,0;linear,0.5;diffusealpha,1
LabelP2OffCommand=linear,0.5;diffusealpha,0
PrimaryOnCommand=x,SCREEN_CENTER_X;y,-6;zoom,0.7;shadowlength,2
SecondaryOnCommand=x,SCREEN_CENTER_X;y,6;zoom,0.5;shadowlength,2
MappedToP1S1Command=x,SCREEN_CENTER_X-270
MappedToP1S2Command=x,SCREEN_CENTER_X-195
@@ -2593,9 +2597,9 @@ MappedToP2S1Command=x,SCREEN_CENTER_X+120
MappedToP2S2Command=x,SCREEN_CENTER_X+195
MappedToP2S3Command=x,SCREEN_CENTER_X+270
MappedToOnCommand=diffuse,#808080;zoom,0.5;shadowlength,0
MappedToWaitingCommand=diffuse,#FF8080;pulse;effectperiod,0.5;effectmagnitude,0.5,0.6,1
MappedToMappedInputCommand=diffuse,#FFFFFF;stopeffect
MappedToGainFocusCommand=diffuse,#FFFFFF;stopeffect
MappedToWaitingCommand=diffuse,#FF8080;pulse;effectperiod,0.5;effectmagnitude,0.8,1.3,1
MappedToMappedInputCommand=diffuse,#808080;diffuseshift;effectcolor2,#808080;effectcolor1,#FFFFFF
MappedToGainFocusCommand=diffuse,#808080;diffuseshift;effectcolor2,#808080;effectcolor1,#FFFFFF
MappedToLoseFocusCommand=diffuse,#808080;stopeffect
[ScreenCenterImage]
+43 -17
View File
@@ -25,6 +25,7 @@ static const int NUM_CHANGABLE_SLOTS = NUM_SHOWN_GAME_TO_DEVICE_SLOTS-1;
REGISTER_SCREEN_CLASS( ScreenMapControllers );
static LocalizedString PLAYER_SLOTS( "ScreenMapControllers", "%s slots" );
void ScreenMapControllers::Init()
{
ScreenWithMenuElements::Init();
@@ -56,18 +57,39 @@ void ScreenMapControllers::Init()
}
}
int iRow = 0;
// header row
{
for( int c=0; c<MAX_GAME_CONTROLLERS; c++ )
{
BitmapText &text = m_textLabel[c];
text.LoadFromFont( THEME->GetPathF("Common","title") );
PlayerNumber pn = (PlayerNumber)c;
text.SetName( "Label"+PlayerNumberToString(pn) );
RString sText = ssprintf(PLAYER_SLOTS.GetValue(), PlayerNumberToLocalizedString(pn).c_str());
text.SetText( sText );
ActorUtil::LoadAllCommands( text, m_sName );
m_Line[iRow].AddChild( &m_textLabel[c] );
}
m_LineScroller.AddChild( &m_Line[iRow] );
iRow++;
}
// normal rows
for( unsigned b=0; b<m_KeysToMap.size(); b++ )
{
KeyToMap *pKey = &m_KeysToMap[b];
{
BitmapText *pName = new BitmapText;
pName->SetName( "Title" );
pName->SetName( "Primary" );
pName->LoadFromFont( THEME->GetPathF("Common","title") );
RString sText = GameButtonToLocalizedString( GAMESTATE->GetCurrentGame(), pKey->m_GameButton );
pName->SetText( sText );
ActorUtil::LoadAllCommands( *pName, m_sName );
m_Line[b].AddChild( pName );
m_Line[iRow].AddChild( pName );
}
{
BitmapText *pSecondary = new BitmapText;
@@ -79,35 +101,39 @@ void ScreenMapControllers::Init()
sText = MenuButtonToLocalizedString( mb );
ActorUtil::LoadAllCommands( *pSecondary, m_sName );
pSecondary->SetText( sText );
m_Line[b].AddChild( pSecondary );
m_Line[iRow].AddChild( pSecondary );
}
for( int p=0; p<MAX_GAME_CONTROLLERS; p++ )
for( int c=0; c<MAX_GAME_CONTROLLERS; c++ )
{
for( int s=0; s<NUM_SHOWN_GAME_TO_DEVICE_SLOTS; s++ )
{
pKey->m_textMappedTo[p][s] = new BitmapText;
pKey->m_textMappedTo[p][s]->SetName( "MappedTo" );
pKey->m_textMappedTo[p][s]->LoadFromFont( THEME->GetPathF(m_sName,"entry") );
pKey->m_textMappedTo[p][s]->RunCommands( MAPPED_TO_COMMAND(p,s) );
ActorUtil::LoadAllCommands( *pKey->m_textMappedTo[p][s], m_sName );
m_Line[b].AddChild( pKey->m_textMappedTo[p][s] );
pKey->m_textMappedTo[c][s] = new BitmapText;
pKey->m_textMappedTo[c][s]->SetName( "MappedTo" );
pKey->m_textMappedTo[c][s]->LoadFromFont( THEME->GetPathF(m_sName,"entry") );
pKey->m_textMappedTo[c][s]->RunCommands( MAPPED_TO_COMMAND(c,s) );
ActorUtil::LoadAllCommands( *pKey->m_textMappedTo[c][s], m_sName );
m_Line[iRow].AddChild( pKey->m_textMappedTo[c][s] );
}
}
m_Line[b].DeleteChildrenWhenDone();
m_Line[b].SetName( "Line" );
ActorUtil::LoadAllCommands( m_Line[b], m_sName );
m_LineScroller.AddChild( &m_Line[b] );
m_Line[iRow].DeleteChildrenWhenDone();
m_Line[iRow].SetName( "Line" );
ActorUtil::LoadAllCommands( m_Line[iRow], m_sName );
m_LineScroller.AddChild( &m_Line[iRow] );
iRow++;
}
// exit row
{
m_pExit = ActorUtil::MakeActor( THEME->GetPathG(m_sName,"exit") );
m_pExit->SetName( "Exit" );
ActorUtil::LoadAllCommands( *m_pExit, m_sName );
unsigned b = m_KeysToMap.size();
m_Line[b].AddChild( m_pExit );
m_LineScroller.AddChild( &m_Line[b] );
m_Line[iRow].AddChild( m_pExit );
m_LineScroller.AddChild( &m_Line[iRow] );
iRow++;
}
m_LineScroller.SetName( "LineScroller" );
+4 -1
View File
@@ -44,10 +44,13 @@ private:
BitmapText *m_textMappedTo[MAX_GAME_CONTROLLERS][NUM_SHOWN_GAME_TO_DEVICE_SLOTS];
};
vector<KeyToMap> m_KeysToMap;
BitmapText m_textLabel[MAX_GAME_CONTROLLERS];
// owned by m_Line
Actor *m_pExit;
ActorFrame m_Line[MAX_GAME_BUTTONS+1]; // XXX
ActorFrame m_Line[MAX_GAME_BUTTONS+2]; // label, normal lines, exit
ActorScroller m_LineScroller;
RageSound m_soundChange;