ScreenSelect metrics cleanup

This commit is contained in:
Chris Danford
2003-09-21 20:10:15 +00:00
parent babe533a9e
commit 3f2d2c7f77
36 changed files with 76 additions and 58 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

+15 -2
View File
@@ -80,7 +80,12 @@ BounceJoinMessage=1
FoldOnJoin=1
[ScreenSelectStyle]
Choices=single,versus,couple,double,solo
NumChoices=5
Choice1=Style,single
Choice2=Style,versus
Choice3=Style,couple
Choice4=Style,double
Choice5=Style,solo
HelpText=Use &LEFT; &RIGHT; to select, then press START
TimerSeconds=40
NextScreen1=ScreenSelectDifficulty
@@ -221,7 +226,15 @@ NextScreen=ScreenSelectGroup
HelpText=
[ScreenSelectDifficulty]
Choices=arcade-beginner,arcade-easy,arcade-medium,arcade-hard,nonstop,oni,endless,rave
NumChoices=8
Choice1=PlayMode,arcade;Difficulty,beginner
Choice2=PlayMode,arcade;Difficulty,easy
Choice3=PlayMode,arcade;Difficulty,medium
Choice4=PlayMode,arcade;Difficulty,hard
Choice5=PlayMode,nonstop
Choice6=PlayMode,oni
Choice7=PlayMode,endless
Choice8=PlayMode,rave
NumChoicesOnPage1=4
HelpText=Use &LEFT; &RIGHT; to select, then press START
TimerSeconds=40
+47 -32
View File
@@ -50,52 +50,67 @@ bool ModeChoice::FromString( CString sChoice, bool bIgnoreUnknown )
bool bChoiceIsInvalid = false;
CStringArray asBits;
split( sChoice, "-", asBits );
for( unsigned b=0; b<asBits.size(); b++ )
CStringArray asCommands;
split( sChoice, ";", asCommands );
for( unsigned i=0; i<asCommands.size(); i++ )
{
CString sBit = asBits[b];
CString sCommand = asCommands[i];
Game game = GAMEMAN->StringToGameType( sBit );
if( game != GAME_INVALID )
CStringArray asBits;
split( sCommand, ",", asBits );
CString sName = asBits[0];
CString sValue = (asBits.size()>1) ? asBits[1] : "";
sName.MakeLower();
sValue.MakeLower();
if( sName == "game" )
{
this->game = game;
continue;
Game game = GAMEMAN->StringToGameType( sValue );
if( game != GAME_INVALID )
this->game = game;
else
bChoiceIsInvalid |= true;
}
Style style = GAMEMAN->GameAndStringToStyle( GAMESTATE->m_CurGame, sBit );
if( style != STYLE_INVALID )
if( sName == "style" )
{
this->style = style;
// There is a choices that allows players to choose a style. Allow joining.
GAMESTATE->m_bPlayersCanJoin = true;
continue;
Style style = GAMEMAN->GameAndStringToStyle( GAMESTATE->m_CurGame, sValue );
if( style != STYLE_INVALID )
{
this->style = style;
// There is a choices that allows players to choose a style. Allow joining.
GAMESTATE->m_bPlayersCanJoin = true;
}
else
bChoiceIsInvalid |= true;
}
PlayMode pm = StringToPlayMode( sBit );
if( pm != PLAY_MODE_INVALID )
if( sName == "playmode" )
{
this->pm = pm;
continue;
PlayMode pm = StringToPlayMode( sValue );
if( pm != PLAY_MODE_INVALID )
this->pm = pm;
else
bChoiceIsInvalid |= true;
}
Difficulty dc = StringToDifficulty( sBit );
if( dc != DIFFICULTY_INVALID )
if( sName == "difficulty" )
{
this->dc = dc;
continue;
Difficulty dc = StringToDifficulty( sValue );
if( dc != DIFFICULTY_INVALID )
this->dc = dc;
else
bChoiceIsInvalid |= true;
}
if( sName == "announcer" )
{
sAnnouncer = sValue;
}
// Never show this error to the user. It occurs all the time in
// non-dance gametypes.
// if( !bIgnoreUnknown )
// {
// CString sError = ssprintf( "The choice token '%s' is not recognized as a Game, Style, PlayMode, or Difficulty. The choice containing this token will be ignored.", sBit.c_str() );
// LOG->Warn( sError );
// if( DISPLAY->IsWindowed() )
// HOOKS->MessageBoxOK( sError );
// }
bChoiceIsInvalid |= true;
}
if( this->style != STYLE_INVALID )
+7 -17
View File
@@ -28,16 +28,12 @@
#include "arch/ArchHooks/ArchHooks.h"
#define CHOICES THEME->GetMetric (m_sName,"Choices")
#define NUM_CHOICES THEME->GetMetricI(m_sName,"NumChoices")
#define CHOICE( choice ) THEME->GetMetric (m_sName,ssprintf("Choice%d",choice+1))
#define HELP_TEXT THEME->GetMetric (m_sName,"HelpText")
#define TIMER_SECONDS THEME->GetMetricI(m_sName,"TimerSeconds")
#define NEXT_SCREEN( choice ) THEME->GetMetric (m_sName,ssprintf("NextScreen%d",choice+1))
// Temporary hack: specify announcer in selection
#define SPECIFY_ANNOUNCER THEME->HasMetric(m_sName,"Announcer1")
#define ANNOUNCER( choice ) THEME->GetMetric (m_sName,ssprintf("Announcer%d",choice+1))
ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName)
{
LOG->Trace( "ScreenSelect::ScreenSelect()" );
@@ -48,19 +44,13 @@ ScreenSelect::ScreenSelect( CString sClassName ) : Screen(sClassName)
// Set this true later if we discover a choice that chooses the Style
CStringArray asChoices;
split( CHOICES, ",", asChoices );
for( unsigned c=0; c<asChoices.size(); c++ )
for( unsigned c=0; c<NUM_CHOICES; c++ )
{
CString sChoice = CHOICE(c);
ModeChoice mc;
if( SPECIFY_ANNOUNCER )
mc.sAnnouncer = ANNOUNCER( c );
if( mc.FromString(asChoices[c]) )
m_aModeChoices.push_back( mc );
mc.FromString(sChoice);
m_aModeChoices.push_back( mc );
CString sBGAnimationDir = THEME->GetPathTo(BGAnimations, ssprintf("%s %s",m_sName.c_str(),mc.name), true); // true="optional"
if( sBGAnimationDir == "" )
+4 -4
View File
@@ -53,13 +53,13 @@ ScreenSelectDifficulty::ScreenSelectDifficulty() : ScreenSelect( "ScreenSelectDi
m_ModeChoices[PAGE_2].push_back( m_aModeChoices[c] );
}
c = 0;
for( int page=0; page<NUM_PAGES; page++ )
{
for( unsigned choice=0; choice<m_ModeChoices[page].size(); choice++ )
for( unsigned choice=0; choice<m_ModeChoices[page].size(); choice++, c++ )
{
CString sInfoFile = ssprintf( "ScreenSelectDifficulty info %s", m_ModeChoices[page][choice].name );
CString sPictureFile = ssprintf( "ScreenSelectDifficulty picture %s", m_ModeChoices[page][choice].name );
CString sInfoFile = ssprintf( "ScreenSelectDifficulty info%d", c+1 );
CString sPictureFile = ssprintf( "ScreenSelectDifficulty picture%d", c+1 );
m_sprPicture[page][choice].SetName( ssprintf("PicturePage%dChoice%d",page+1,choice+1) );
m_sprPicture[page][choice].Load( THEME->GetPathToG(sPictureFile) );
+3 -3
View File
@@ -38,7 +38,7 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
//
// Load icon
//
CString sIconElementName = ssprintf("ScreenSelectStyle icon %s", mc.name );
CString sIconElementName = ssprintf("ScreenSelectStyle icon%d",i+1);
CString sIconPath = THEME->GetPathToG(sIconElementName);
m_textIcon[i].SetName( ssprintf("Icon%d",i+1) );
@@ -61,7 +61,7 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
//
// Load Picture
//
CString sPictureElementName = ssprintf("ScreenSelectStyle picture %s", mc.name );
CString sPictureElementName = ssprintf("ScreenSelectStyle picture%d",i+1);
CString sPicturePath = THEME->GetPathToG(sPictureElementName);
if( sPicturePath != "" )
{
@@ -75,7 +75,7 @@ ScreenSelectStyle::ScreenSelectStyle() : ScreenSelect( "ScreenSelectStyle" )
//
// Load info
//
CString sInfoElementName = ssprintf("ScreenSelectStyle info %s", mc.name );
CString sInfoElementName = ssprintf("ScreenSelectStyle info%d",i+1);
CString sInfoPath = THEME->GetPathToG(sInfoElementName);
if( sInfoPath != "" )
{