XToThemedString -> XToLocalizedString

This commit is contained in:
Chris Danford
2006-01-07 04:11:29 +00:00
parent b2c86171d1
commit 44225ad379
61 changed files with 253 additions and 236 deletions
+3 -2
View File
@@ -8,6 +8,7 @@
#include "Quad.h" #include "Quad.h"
#include "AutoActor.h" #include "AutoActor.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "LocalizedString.h"
class Song; class Song;
class Course; class Course;
struct DisplayBpms; struct DisplayBpms;
@@ -34,8 +35,8 @@ protected:
ThemeMetric<RageColor> CHANGE_COLOR; ThemeMetric<RageColor> CHANGE_COLOR;
ThemeMetric<RageColor> EXTRA_COLOR; ThemeMetric<RageColor> EXTRA_COLOR;
ThemeMetric<bool> CYCLE; ThemeMetric<bool> CYCLE;
ThemeMetric<CString> SEPARATOR; LocalizedString SEPARATOR;
ThemeMetric<CString> NO_BPM_TEXT; LocalizedString NO_BPM_TEXT;
BitmapText m_textBPM; BitmapText m_textBPM;
AutoActor m_sprLabel; AutoActor m_sprLabel;
+10 -10
View File
@@ -75,7 +75,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
XNode* p3 = p2->AppendChild( "StepsType" ); XNode* p3 = p2->AppendChild( "StepsType" );
p3->AppendAttr( "StepsType", GAMEMAN->StepsTypeToString(*st) ); p3->AppendAttr( "StepsType", GAMEMAN->StepsTypeToString(*st) );
int iNumStepsInGroupAndStepsType[NUM_DIFFICULTIES]; int iNumStepsInGroupAndStepsType[NUM_Difficulty];
ZERO( iNumStepsInGroupAndStepsType ); ZERO( iNumStepsInGroupAndStepsType );
FOREACH_CONST( Song*, vpSongsInGroup, i ) FOREACH_CONST( Song*, vpSongsInGroup, i )
{ {
@@ -250,7 +250,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), iter ) FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), iter )
{ {
XNode* pNode3 = pNode2->AppendChild( "Difficulty", DifficultyToString(*iter) ); XNode* pNode3 = pNode2->AppendChild( "Difficulty", DifficultyToString(*iter) );
pNode3->AppendAttr( "DisplayAs", DifficultyToThemedString(*iter) ); pNode3->AppendAttr( "DisplayAs", DifficultyToLocalizedString(*iter) );
} }
} }
@@ -259,7 +259,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_CONST( CourseDifficulty, CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter ) FOREACH_CONST( CourseDifficulty, CommonMetrics::COURSE_DIFFICULTIES_TO_SHOW.GetValue(), iter )
{ {
XNode* pNode3 = pNode2->AppendChild( "CourseDifficulty", CourseDifficultyToString(*iter) ); XNode* pNode3 = pNode2->AppendChild( "CourseDifficulty", CourseDifficultyToString(*iter) );
pNode3->AppendAttr( "DisplayAs", CourseDifficultyToThemedString(*iter) ); pNode3->AppendAttr( "DisplayAs", CourseDifficultyToLocalizedString(*iter) );
} }
} }
@@ -268,7 +268,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_CONST( StepsType, vStepsTypesToShow, iter ) FOREACH_CONST( StepsType, vStepsTypesToShow, iter )
{ {
XNode* pNode3 = pNode2->AppendChild( "StepsType", GAMEMAN->StepsTypeToString(*iter) ); XNode* pNode3 = pNode2->AppendChild( "StepsType", GAMEMAN->StepsTypeToString(*iter) );
pNode3->AppendAttr( "DisplayAs", GAMEMAN->StepsTypeToThemedString(*iter) ); pNode3->AppendAttr( "DisplayAs", GAMEMAN->StepsTypeToLocalizedString(*iter) );
} }
} }
@@ -279,7 +279,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
if( !SHOW_PLAY_MODE(pm) ) if( !SHOW_PLAY_MODE(pm) )
continue; continue;
XNode* pNode3 = pNode2->AppendChild( "PlayMode", PlayModeToString(pm) ); XNode* pNode3 = pNode2->AppendChild( "PlayMode", PlayModeToString(pm) );
pNode3->AppendAttr( "DisplayAs", PlayModeToThemedString(pm) ); pNode3->AppendAttr( "DisplayAs", PlayModeToLocalizedString(pm) );
} }
} }
@@ -294,7 +294,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
StyleID sID; StyleID sID;
sID.FromStyle( (*pStyle) ); sID.FromStyle( (*pStyle) );
XNode* pNode3 = pNode2->AppendChild( sID.CreateNode() ); XNode* pNode3 = pNode2->AppendChild( sID.CreateNode() );
pNode3->AppendAttr( "DisplayAs", GAMEMAN->StyleToThemedString(*pStyle) ); pNode3->AppendAttr( "DisplayAs", GAMEMAN->StyleToLocalizedString(*pStyle) );
} }
} }
@@ -312,7 +312,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_UsedGrade( g ) FOREACH_UsedGrade( g )
{ {
XNode* pNode3 = pNode2->AppendChild( "Grade", GradeToString(g) ); XNode* pNode3 = pNode2->AppendChild( "Grade", GradeToString(g) );
pNode3->AppendAttr( "DisplayAs", GradeToThemedString(g) ); pNode3->AppendAttr( "DisplayAs", GradeToLocalizedString(g) );
} }
} }
@@ -321,7 +321,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_TapNoteScore( tns ) FOREACH_TapNoteScore( tns )
{ {
XNode* pNode3 = pNode2->AppendChild( "TapNoteScore", TapNoteScoreToString(tns) ); XNode* pNode3 = pNode2->AppendChild( "TapNoteScore", TapNoteScoreToString(tns) );
pNode3->AppendAttr( "DisplayAs", TapNoteScoreToThemedString(tns) ); pNode3->AppendAttr( "DisplayAs", TapNoteScoreToLocalizedString(tns) );
} }
} }
@@ -330,7 +330,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_HoldNoteScore( hns ) FOREACH_HoldNoteScore( hns )
{ {
XNode* pNode3 = pNode2->AppendChild( "HoldNoteScore", HoldNoteScoreToString(hns) ); XNode* pNode3 = pNode2->AppendChild( "HoldNoteScore", HoldNoteScoreToString(hns) );
pNode3->AppendAttr( "DisplayAs", HoldNoteScoreToThemedString(hns) ); pNode3->AppendAttr( "DisplayAs", HoldNoteScoreToLocalizedString(hns) );
} }
} }
@@ -339,7 +339,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_RadarCategory( rc ) FOREACH_RadarCategory( rc )
{ {
XNode* pNode3 = pNode2->AppendChild( "RadarValue", RadarCategoryToString(rc) ); XNode* pNode3 = pNode2->AppendChild( "RadarValue", RadarCategoryToString(rc) );
pNode3->AppendAttr( "DisplayAs", RadarCategoryToThemedString(rc) ); pNode3->AppendAttr( "DisplayAs", RadarCategoryToLocalizedString(rc) );
} }
} }
+1 -1
View File
@@ -14,7 +14,7 @@ ThemeMetric<CString> CommonMetrics::FIRST_ATTRACT_SCREEN ("Common","FirstA
ThemeMetric<CString> CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" ); ThemeMetric<CString> CommonMetrics::DEFAULT_MODIFIERS ("Common","DefaultModifiers" );
ThemeMetric<CString> CommonMetrics::DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" ); ThemeMetric<CString> CommonMetrics::DEFAULT_CPU_MODIFIERS ("Common","DefaultCpuModifiers" );
ThemeMetric1D<apActorCommands> CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS); ThemeMetric1D<apActorCommands> CommonMetrics::PLAYER_COLOR ("Common",PLAYER_COLOR_NAME,NUM_PLAYERS);
ThemeMetric<CString> CommonMetrics::WINDOW_TITLE ("Common","WindowTitle"); LocalizedString CommonMetrics::WINDOW_TITLE ("Common","WindowTitle");
ThemeMetric<int> CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS("Common","MaxCourseEntriesBeforeShowVarious"); ThemeMetric<int> CommonMetrics::MAX_COURSE_ENTRIES_BEFORE_VARIOUS("Common","MaxCourseEntriesBeforeShowVarious");
ThemeMetric<float> CommonMetrics::TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds"); ThemeMetric<float> CommonMetrics::TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow"); ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
+2 -1
View File
@@ -7,6 +7,7 @@
#include "PlayerNumber.h" #include "PlayerNumber.h"
#include "Difficulty.h" #include "Difficulty.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "LocalizedString.h"
// //
@@ -54,7 +55,7 @@ namespace CommonMetrics
extern ThemeMetric<CString> DEFAULT_MODIFIERS; extern ThemeMetric<CString> DEFAULT_MODIFIERS;
extern ThemeMetric<CString> DEFAULT_CPU_MODIFIERS; extern ThemeMetric<CString> DEFAULT_CPU_MODIFIERS;
extern ThemeMetric1D<apActorCommands> PLAYER_COLOR; extern ThemeMetric1D<apActorCommands> PLAYER_COLOR;
extern ThemeMetric<CString> WINDOW_TITLE; extern LocalizedString WINDOW_TITLE;
extern ThemeMetric<int> MAX_COURSE_ENTRIES_BEFORE_VARIOUS; extern ThemeMetric<int> MAX_COURSE_ENTRIES_BEFORE_VARIOUS;
extern ThemeMetric<float> TICK_EARLY_SECONDS; extern ThemeMetric<float> TICK_EARLY_SECONDS;
extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
+6 -5
View File
@@ -22,6 +22,7 @@
#include <limits.h> #include <limits.h>
#include "CourseLoaderCRS.h" #include "CourseLoaderCRS.h"
#include "LuaFunctions.h" #include "LuaFunctions.h"
#include "LocalizedString.h"
static const char *CourseTypeNames[] = { static const char *CourseTypeNames[] = {
@@ -31,9 +32,9 @@ static const char *CourseTypeNames[] = {
"Survival", "Survival",
}; };
XToString( CourseType, NUM_CourseType ); XToString( CourseType, NUM_CourseType );
XToThemedString( CourseType, NUM_CourseType ); XToLocalizedString( CourseType );
LuaFunction( CourseTypeToThemedString, CourseTypeToThemedString((CourseType) IArg(1)) ); LuaFunction( CourseTypeToLocalizedString, CourseTypeToLocalizedString((CourseType) IArg(1)) );
static const char *SongSortNames[] = { static const char *SongSortNames[] = {
@@ -44,7 +45,7 @@ static const char *SongSortNames[] = {
"LowestGrades", "LowestGrades",
}; };
XToString( SongSort, NUM_SongSort ); XToString( SongSort, NUM_SongSort );
XToThemedString( SongSort, NUM_SongSort ); XToLocalizedString( SongSort );
/* Maximum lower value of ranges when difficult: */ /* Maximum lower value of ranges when difficult: */
@@ -67,13 +68,13 @@ CString CourseEntry::GetTextDescription() const
if( !sSongGroup.empty() ) if( !sSongGroup.empty() )
vsEntryDescription.push_back( sSongGroup ); vsEntryDescription.push_back( sSongGroup );
if( baseDifficulty != DIFFICULTY_INVALID && baseDifficulty != DIFFICULTY_MEDIUM ) if( baseDifficulty != DIFFICULTY_INVALID && baseDifficulty != DIFFICULTY_MEDIUM )
vsEntryDescription.push_back( DifficultyToThemedString(baseDifficulty) ); vsEntryDescription.push_back( DifficultyToLocalizedString(baseDifficulty) );
if( iLowMeter != -1 ) if( iLowMeter != -1 )
vsEntryDescription.push_back( ssprintf("Low meter: %d", iLowMeter) ); vsEntryDescription.push_back( ssprintf("Low meter: %d", iLowMeter) );
if( iHighMeter != -1 ) if( iHighMeter != -1 )
vsEntryDescription.push_back( ssprintf("High meter: %d", iHighMeter) ); vsEntryDescription.push_back( ssprintf("High meter: %d", iHighMeter) );
if( songSort != SongSort_Randomize ) if( songSort != SongSort_Randomize )
vsEntryDescription.push_back( "Sort: %d" + SongSortToThemedString(songSort) ); vsEntryDescription.push_back( "Sort: %d" + SongSortToLocalizedString(songSort) );
if( songSort != SongSort_Randomize && iChooseIndex != 0 ) if( songSort != SongSort_Randomize && iChooseIndex != 0 )
vsEntryDescription.push_back( "Choose " + FormatNumberAndSuffix(iChooseIndex) + " match" ); vsEntryDescription.push_back( "Choose " + FormatNumberAndSuffix(iChooseIndex) + " match" );
int iNumModChanges = GetNumModChanges(); int iNumModChanges = GetNumModChanges();
+3 -3
View File
@@ -31,7 +31,7 @@ enum CourseType
}; };
#define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_CourseType, i ) #define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_CourseType, i )
const CString& CourseTypeToString( CourseType i ); const CString& CourseTypeToString( CourseType i );
const CString& CourseTypeToThemedString( CourseType i ); const CString& CourseTypeToLocalizedString( CourseType i );
inline PlayMode CourseTypeToPlayMode( CourseType ct ) { return (PlayMode)(PLAY_MODE_NONSTOP+ct); } inline PlayMode CourseTypeToPlayMode( CourseType ct ) { return (PlayMode)(PLAY_MODE_NONSTOP+ct); }
inline CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); } inline CourseType PlayModeToCourseType( PlayMode pm ) { return (CourseType)(pm-PLAY_MODE_NONSTOP); }
@@ -48,7 +48,7 @@ enum SongSort
}; };
#define FOREACH_SongSort( i ) FOREACH_ENUM( SongSort, NUM_SongSort, i ) #define FOREACH_SongSort( i ) FOREACH_ENUM( SongSort, NUM_SongSort, i )
const CString& SongSortToString( SongSort ss ); const CString& SongSortToString( SongSort ss );
const CString& SongSortToThemedString( SongSort ss ); const CString& SongSortToLocalizedString( SongSort ss );
class CourseEntry class CourseEntry
{ {
@@ -125,7 +125,7 @@ public:
bool m_bRepeat; // repeat after last song? "Endless" bool m_bRepeat; // repeat after last song? "Endless"
bool m_bShuffle; // play the songs in a random order bool m_bShuffle; // play the songs in a random order
int m_iLives; // -1 means use bar life meter int m_iLives; // -1 means use bar life meter
int m_iCustomMeter[NUM_DIFFICULTIES]; // -1 = no meter specified int m_iCustomMeter[NUM_Difficulty]; // -1 = no meter specified
bool m_bSortByMeter; bool m_bSortByMeter;
vector<CourseEntry> m_vEntries; vector<CourseEntry> m_vEntries;
+1 -1
View File
@@ -60,7 +60,7 @@ bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavin
vector<CString> asRadarValues; vector<CString> asRadarValues;
const RadarValues &rv = it->second; const RadarValues &rv = it->second;
for( int r=0; r < NUM_RADAR_CATEGORIES; r++ ) for( int r=0; r < NUM_RadarCategory; r++ )
asRadarValues.push_back( ssprintf("%.3f", rv[r]) ); asRadarValues.push_back( ssprintf("%.3f", rv[r]) );
CString sLine = ssprintf( "#RADAR:%i:%i:", st, cd ); CString sLine = ssprintf( "#RADAR:%i:%i:", st, cd );
sLine += join( ",", asRadarValues ) + ";"; sLine += join( ",", asRadarValues ) + ";";
+3 -3
View File
@@ -207,7 +207,7 @@ CString LastWeekToString( int iLastWeekIndex )
} }
} }
CString LastDayToThemedString( int iLastDayIndex ) CString LastDayToLocalizedString( int iLastDayIndex )
{ {
CString s = LastDayToString( iLastDayIndex ); CString s = LastDayToString( iLastDayIndex );
s.Replace( "Day", "" ); s.Replace( "Day", "" );
@@ -215,7 +215,7 @@ CString LastDayToThemedString( int iLastDayIndex )
return s; return s;
} }
CString LastWeekToThemedString( int iLastWeekIndex ) CString LastWeekToLocalizedString( int iLastWeekIndex )
{ {
CString s = LastWeekToString( iLastWeekIndex ); CString s = LastWeekToString( iLastWeekIndex );
s.Replace( "Week", "" ); s.Replace( "Week", "" );
@@ -223,7 +223,7 @@ CString LastWeekToThemedString( int iLastWeekIndex )
return s; return s;
} }
CString HourInDayToThemedString( int iHourIndex ) CString HourInDayToLocalizedString( int iHourIndex )
{ {
int iBeginHour = iHourIndex; int iBeginHour = iHourIndex;
iBeginHour--; iBeginHour--;
+4 -4
View File
@@ -12,15 +12,15 @@ enum Month { NUM_Month = 12 };
CString DayInYearToString( int iDayInYearIndex ); CString DayInYearToString( int iDayInYearIndex );
CString LastDayToString( int iLastDayIndex ); CString LastDayToString( int iLastDayIndex );
CString LastDayToThemedString( int iLastDayIndex ); CString LastDayToLocalizedString( int iLastDayIndex );
CString DayOfWeekToString( int iDayOfWeekIndex ); CString DayOfWeekToString( int iDayOfWeekIndex );
CString DayOfWeekToThemedString( int iDayOfWeekIndex ); CString DayOfWeekToLocalizedString( int iDayOfWeekIndex );
CString HourInDayToString( int iHourIndex ); CString HourInDayToString( int iHourIndex );
CString HourInDayToThemedString( int iHourIndex ); CString HourInDayToLocalizedString( int iHourIndex );
const CString &MonthToString( Month month ); const CString &MonthToString( Month month );
const CString &MonthToLocalizedString( Month month ); const CString &MonthToLocalizedString( Month month );
CString LastWeekToString( int iLastWeekIndex ); CString LastWeekToString( int iLastWeekIndex );
CString LastWeekToThemedString( int iLastWeekIndex ); CString LastWeekToLocalizedString( int iLastWeekIndex );
tm AddDays( tm start, int iDaysToMove ); tm AddDays( tm start, int iDaysToMove );
tm GetYesterday( tm start ); tm GetYesterday( tm start );
+10 -9
View File
@@ -4,6 +4,7 @@
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "LuaManager.h" #include "LuaManager.h"
#include "LuaFunctions.h" #include "LuaFunctions.h"
#include "LocalizedString.h"
static const char *DifficultyNames[] = { static const char *DifficultyNames[] = {
@@ -14,10 +15,10 @@ static const char *DifficultyNames[] = {
"Challenge", "Challenge",
"Edit", "Edit",
}; };
XToString( Difficulty, NUM_DIFFICULTIES ); XToString( Difficulty, NUM_Difficulty );
XToThemedString( Difficulty, NUM_DIFFICULTIES ); XToLocalizedString( Difficulty );
LuaFunction( DifficultyToThemedString, DifficultyToThemedString((Difficulty) IArg(1)) ); LuaFunction( DifficultyToLocalizedString, DifficultyToLocalizedString((Difficulty) IArg(1)) );
/* We prefer the above names; recognize a number of others, too. (They'l /* We prefer the above names; recognize a number of others, too. (They'l
* get normalized when written to SMs, etc.) */ * get normalized when written to SMs, etc.) */
@@ -54,7 +55,7 @@ static void LuaDifficulty(lua_State* L)
s.MakeUpper(); s.MakeUpper();
LUA->SetGlobal( "DIFFICULTY_"+s, d ); LUA->SetGlobal( "DIFFICULTY_"+s, d );
} }
LUA->SetGlobal( "NUM_DIFFICULTIES", NUM_DIFFICULTIES ); LUA->SetGlobal( "NUM_Difficulty", NUM_Difficulty );
} }
REGISTER_WITH_LUA_FUNCTION( LuaDifficulty ); REGISTER_WITH_LUA_FUNCTION( LuaDifficulty );
@@ -69,15 +70,15 @@ static const char *CourseDifficultyNames[] =
"Challenge", "Challenge",
"Edit", "Edit",
}; };
XToString( CourseDifficulty, NUM_DIFFICULTIES ); XToString( CourseDifficulty, NUM_Difficulty );
XToThemedString( CourseDifficulty, NUM_DIFFICULTIES ); XToLocalizedString( CourseDifficulty );
StringToX( CourseDifficulty ); StringToX( CourseDifficulty );
LuaFunction( CourseDifficultyToThemedString, CourseDifficultyToThemedString((CourseDifficulty)IArg(1)) ); LuaFunction( CourseDifficultyToLocalizedString, CourseDifficultyToLocalizedString((CourseDifficulty)IArg(1)) );
CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd ) CourseDifficulty GetNextShownCourseDifficulty( CourseDifficulty cd )
{ {
for( CourseDifficulty d=(CourseDifficulty)(cd+1); d<NUM_DIFFICULTIES; ((int&)d)++ ) for( CourseDifficulty d=(CourseDifficulty)(cd+1); d<NUM_Difficulty; ((int&)d)++ )
{ {
if( GAMESTATE->IsCourseDifficultyShown(d) ) if( GAMESTATE->IsCourseDifficultyShown(d) )
return d; return d;
@@ -93,7 +94,7 @@ static void LuaCourseDifficulty(lua_State* L)
s.MakeUpper(); s.MakeUpper();
LUA->SetGlobal( "COURSE_DIFFICULTY_"+s, d ); LUA->SetGlobal( "COURSE_DIFFICULTY_"+s, d );
} }
LUA->SetGlobal( "NUM_COURSE_DIFFICULTIES", NUM_COURSE_DIFFICULTIES ); LUA->SetGlobal( "NUM_CourseDifficulty", NUM_CourseDifficulty );
} }
REGISTER_WITH_LUA_FUNCTION( LuaCourseDifficulty ); REGISTER_WITH_LUA_FUNCTION( LuaCourseDifficulty );
+5 -5
View File
@@ -14,22 +14,22 @@ enum Difficulty
DIFFICULTY_HARD, DIFFICULTY_HARD,
DIFFICULTY_CHALLENGE, DIFFICULTY_CHALLENGE,
DIFFICULTY_EDIT, DIFFICULTY_EDIT,
NUM_DIFFICULTIES, NUM_Difficulty,
DIFFICULTY_INVALID DIFFICULTY_INVALID
}; };
#define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_DIFFICULTIES, dc ) #define FOREACH_Difficulty( dc ) FOREACH_ENUM( Difficulty, NUM_Difficulty, dc )
const CString& DifficultyToString( Difficulty dc ); const CString& DifficultyToString( Difficulty dc );
const CString& DifficultyToThemedString( Difficulty dc ); const CString& DifficultyToLocalizedString( Difficulty dc );
Difficulty StringToDifficulty( const CString& sDC ); Difficulty StringToDifficulty( const CString& sDC );
typedef Difficulty CourseDifficulty; typedef Difficulty CourseDifficulty;
#define NUM_COURSE_DIFFICULTIES NUM_DIFFICULTIES #define NUM_CourseDifficulty NUM_Difficulty
#define FOREACH_CourseDifficulty FOREACH_Difficulty #define FOREACH_CourseDifficulty FOREACH_Difficulty
#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_INVALID; cd=GetNextShownCourseDifficulty(cd) ) #define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_INVALID; cd=GetNextShownCourseDifficulty(cd) )
const CString& CourseDifficultyToString( Difficulty dc ); const CString& CourseDifficultyToString( Difficulty dc );
const CString& CourseDifficultyToThemedString( Difficulty dc ); const CString& CourseDifficultyToLocalizedString( Difficulty dc );
Difficulty StringToCourseDifficulty( const CString& sDC ); Difficulty StringToCourseDifficulty( const CString& sDC );
Difficulty GetNextShownCourseDifficulty( Difficulty pn ); Difficulty GetNextShownCourseDifficulty( Difficulty pn );
+1 -1
View File
@@ -14,7 +14,7 @@ DifficultyDisplay::DifficultyDisplay()
int diff; int diff;
for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff ) for( diff = DIFFICULTY_BEGINNER; diff <= DIFFICULTY_CHALLENGE; ++diff )
{ {
m_difficulty[diff].Load( THEME->GetPathG("DifficultyDisplay",ssprintf("bar %dx1",NUM_DIFFICULTIES)) ); m_difficulty[diff].Load( THEME->GetPathG("DifficultyDisplay",ssprintf("bar %dx1",NUM_Difficulty)) );
m_difficulty[diff].SetState(diff); m_difficulty[diff].SetState(diff);
m_difficulty[diff].StopAnimating(); m_difficulty[diff].StopAnimating();
this->AddChild( &m_difficulty[diff] ); this->AddChild( &m_difficulty[diff] );
+1 -1
View File
@@ -16,7 +16,7 @@ public:
void UnsetDifficulties(); void UnsetDifficulties();
protected: protected:
Sprite m_difficulty[NUM_DIFFICULTIES]; Sprite m_difficulty[NUM_Difficulty];
}; };
#endif #endif
+5 -5
View File
@@ -22,7 +22,7 @@ bool DifficultyIcon::Load( CString sPath )
{ {
Sprite::Load( sPath ); Sprite::Load( sPath );
int iStates = GetNumStates(); int iStates = GetNumStates();
bool bWarn = iStates != NUM_DIFFICULTIES && iStates != NUM_DIFFICULTIES*2; bool bWarn = iStates != NUM_Difficulty && iStates != NUM_Difficulty*2;
if( sPath.find("_blank") != string::npos ) if( sPath.find("_blank") != string::npos )
bWarn = false; bWarn = false;
if( bWarn ) if( bWarn )
@@ -30,8 +30,8 @@ bool DifficultyIcon::Load( CString sPath )
CString sError = ssprintf( CString sError = ssprintf(
"The difficulty icon graphic '%s' must have %d or %d frames. It has %d states.", "The difficulty icon graphic '%s' must have %d or %d frames. It has %d states.",
sPath.c_str(), sPath.c_str(),
NUM_DIFFICULTIES, NUM_Difficulty,
NUM_DIFFICULTIES*2, NUM_Difficulty*2,
iStates ); iStates );
Dialog::OK( sError ); Dialog::OK( sError );
} }
@@ -75,8 +75,8 @@ void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
m_bBlank = false; m_bBlank = false;
switch( GetNumStates() ) switch( GetNumStates() )
{ {
case NUM_DIFFICULTIES: SetState( dc ); break; case NUM_Difficulty: SetState( dc ); break;
case NUM_DIFFICULTIES*2: SetState( dc*2+pn ); break; case NUM_Difficulty*2: SetState( dc*2+pn ); break;
default: m_bBlank = true; break; default: m_bBlank = true; break;
} }
} }
+1 -1
View File
@@ -14,7 +14,7 @@
#include "Command.h" #include "Command.h"
#include "Foreach.h" #include "Foreach.h"
#define MAX_METERS NUM_DIFFICULTIES + MAX_EDITS_PER_SONG #define MAX_METERS NUM_Difficulty + MAX_EDITS_PER_SONG
DifficultyList::DifficultyList() DifficultyList::DifficultyList()
{ {
+1 -1
View File
@@ -64,7 +64,7 @@ void DifficultyMeter::Load( const CString &sType )
CString Feet; CString Feet;
if( !m_bAutoColorFeet ) if( !m_bAutoColorFeet )
{ {
for( unsigned i = 0; i < NUM_DIFFICULTIES; ++i ) for( unsigned i = 0; i < NUM_Difficulty; ++i )
Feet += char(i + '0'); // 01234 Feet += char(i + '0'); // 01234
Feet += 'X'; // Off Feet += 'X'; // Off
} }
+14 -14
View File
@@ -24,8 +24,8 @@ static const char *EditMenuRowNames[] = {
"SourceSteps", "SourceSteps",
"Action" "Action"
}; };
XToString( EditMenuRow, NUM_EDIT_MENU_ROWS ); XToString( EditMenuRow, NUM_EditMenuRow );
XToThemedString( EditMenuRow, NUM_EDIT_MENU_ROWS ); XToLocalizedString( EditMenuRow );
static const char *EditMenuActionNames[] = { static const char *EditMenuActionNames[] = {
"Edit", "Edit",
@@ -34,7 +34,7 @@ static const char *EditMenuActionNames[] = {
"Practice", "Practice",
}; };
XToString( EditMenuAction, NUM_EditMenuAction ); XToString( EditMenuAction, NUM_EditMenuAction );
XToThemedString( EditMenuAction, NUM_EditMenuAction ); XToLocalizedString( EditMenuAction );
StringToX( EditMenuAction ); StringToX( EditMenuAction );
static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); } static CString ARROWS_X_NAME( size_t i ) { return ssprintf("Arrows%dX",int(i+1)); }
@@ -109,9 +109,9 @@ void EditMenu::Load( const CString &sType )
GROUP_BANNER_HEIGHT.Load(sType,"GroupBannerHeight"); GROUP_BANNER_HEIGHT.Load(sType,"GroupBannerHeight");
ROW_LABELS_X.Load(sType,"RowLabelsX"); ROW_LABELS_X.Load(sType,"RowLabelsX");
ROW_LABEL_ON_COMMAND.Load(sType,"RowLabelOnCommand"); ROW_LABEL_ON_COMMAND.Load(sType,"RowLabelOnCommand");
ROW_VALUE_X.Load(sType,ROW_VALUE_X_NAME,NUM_EDIT_MENU_ROWS); ROW_VALUE_X.Load(sType,ROW_VALUE_X_NAME,NUM_EditMenuRow);
ROW_VALUE_ON_COMMAND.Load(sType,"RowValueOnCommand"); ROW_VALUE_ON_COMMAND.Load(sType,"RowValueOnCommand");
ROW_Y.Load(sType,ROW_Y_NAME,NUM_EDIT_MENU_ROWS); ROW_Y.Load(sType,ROW_Y_NAME,NUM_EditMenuRow);
EDIT_MODE.Load(sType,"EditMode"); EDIT_MODE.Load(sType,"EditMode");
for( int i=0; i<2; i++ ) for( int i=0; i<2; i++ )
@@ -130,7 +130,7 @@ void EditMenu::Load( const CString &sType )
{ {
m_textLabel[r].LoadFromFont( THEME->GetPathF(sType,"title") ); m_textLabel[r].LoadFromFont( THEME->GetPathF(sType,"title") );
m_textLabel[r].SetXY( ROW_LABELS_X, ROW_Y.GetValue(r) ); m_textLabel[r].SetXY( ROW_LABELS_X, ROW_Y.GetValue(r) );
m_textLabel[r].SetText( EditMenuRowToThemedString(r) ); m_textLabel[r].SetText( EditMenuRowToLocalizedString(r) );
m_textLabel[r].RunCommands( ROW_LABEL_ON_COMMAND ); m_textLabel[r].RunCommands( ROW_LABEL_ON_COMMAND );
m_textLabel[r].SetHorizAlign( Actor::align_left ); m_textLabel[r].SetHorizAlign( Actor::align_left );
this->AddChild( &m_textLabel[r] ); this->AddChild( &m_textLabel[r] );
@@ -238,7 +238,7 @@ bool EditMenu::CanGoUp()
bool EditMenu::CanGoDown() bool EditMenu::CanGoDown()
{ {
return m_SelectedRow != NUM_EDIT_MENU_ROWS-1; return m_SelectedRow != NUM_EditMenuRow-1;
} }
bool EditMenu::CanGoLeft() bool EditMenu::CanGoLeft()
@@ -359,7 +359,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
m_SongTextBanner.LoadFromSong( GetSelectedSong() ); m_SongTextBanner.LoadFromSong( GetSelectedSong() );
// fall through // fall through
case ROW_STEPS_TYPE: case ROW_STEPS_TYPE:
m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToThemedString(GetSelectedStepsType()) ); m_textValue[ROW_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedStepsType()) );
m_vpSteps.clear(); m_vpSteps.clear();
@@ -437,11 +437,11 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
s += "-no name-"; s += "-no name-";
else else
s += pSteps->GetDescription(); s += pSteps->GetDescription();
s += " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")"; s += " (" + DifficultyToLocalizedString(DIFFICULTY_EDIT) + ")";
} }
else else
{ {
s = DifficultyToThemedString(GetSelectedDifficulty()); s = DifficultyToLocalizedString(GetSelectedDifficulty());
// UGLY. "Edit" -> "New Edit" // UGLY. "Edit" -> "New Edit"
switch( EDIT_MODE.GetValue() ) switch( EDIT_MODE.GetValue() )
@@ -466,7 +466,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
case ROW_SOURCE_STEPS_TYPE: case ROW_SOURCE_STEPS_TYPE:
m_textLabel[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false ); m_textLabel[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false ); m_textValue[ROW_SOURCE_STEPS_TYPE].SetHidden( GetSelectedSteps() ? true : false );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToThemedString(GetSelectedSourceStepsType()) ); m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedSourceStepsType()) );
m_vpSourceSteps.clear(); m_vpSourceSteps.clear();
m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,DIFFICULTY_INVALID) ); // "blank" m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,DIFFICULTY_INVALID) ); // "blank"
@@ -501,9 +501,9 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
if( GetSelectedSourceDifficulty() == DIFFICULTY_INVALID ) if( GetSelectedSourceDifficulty() == DIFFICULTY_INVALID )
s = "Blank"; s = "Blank";
else if( pSourceSteps && GetSelectedSourceDifficulty() == DIFFICULTY_EDIT ) else if( pSourceSteps && GetSelectedSourceDifficulty() == DIFFICULTY_EDIT )
s = pSourceSteps->GetDescription() + " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")"; s = pSourceSteps->GetDescription() + " (" + DifficultyToLocalizedString(DIFFICULTY_EDIT) + ")";
else else
s = DifficultyToThemedString(GetSelectedSourceDifficulty()); s = DifficultyToLocalizedString(GetSelectedSourceDifficulty());
m_textValue[ROW_SOURCE_STEPS].SetText( s ); m_textValue[ROW_SOURCE_STEPS].SetText( s );
} }
bool bHideMeter = false; bool bHideMeter = false;
@@ -540,7 +540,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
} }
// fall through // fall through
case ROW_ACTION: case ROW_ACTION:
m_textValue[ROW_ACTION].SetText( EditMenuActionToThemedString(GetSelectedAction()) ); m_textValue[ROW_ACTION].SetText( EditMenuActionToLocalizedString(GetSelectedAction()) );
break; break;
default: default:
ASSERT(0); // invalid row ASSERT(0); // invalid row
+7 -7
View File
@@ -23,11 +23,11 @@ enum EditMenuRow
ROW_SOURCE_STEPS_TYPE, ROW_SOURCE_STEPS_TYPE,
ROW_SOURCE_STEPS, ROW_SOURCE_STEPS,
ROW_ACTION, ROW_ACTION,
NUM_EDIT_MENU_ROWS NUM_EditMenuRow
}; };
#define FOREACH_EditMenuRow( r ) FOREACH_ENUM( EditMenuRow, NUM_EDIT_MENU_ROWS, r ) #define FOREACH_EditMenuRow( r ) FOREACH_ENUM( EditMenuRow, NUM_EditMenuRow, r )
const CString& EditMenuRowToString( EditMenuRow r ); const CString& EditMenuRowToString( EditMenuRow r );
const CString& EditMenuRowToThemedString( EditMenuRow r ); const CString& EditMenuRowToLocalizedString( EditMenuRow r );
enum EditMenuAction enum EditMenuAction
{ {
@@ -39,7 +39,7 @@ enum EditMenuAction
}; };
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema ) #define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema )
const CString& EditMenuActionToString( EditMenuAction ema ); const CString& EditMenuActionToString( EditMenuAction ema );
const CString& EditMenuActionToThemedString( EditMenuAction ema ); const CString& EditMenuActionToLocalizedString( EditMenuAction ema );
const int NUM_ARROWS = 2; const int NUM_ARROWS = 2;
@@ -84,9 +84,9 @@ private:
EditMenuRow m_SelectedRow; EditMenuRow m_SelectedRow;
EditMenuRow GetFirstRow() const { return SHOW_GROUPS.GetValue()? ROW_GROUP:ROW_SONG; } EditMenuRow GetFirstRow() const { return SHOW_GROUPS.GetValue()? ROW_GROUP:ROW_SONG; }
int GetRowSize( EditMenuRow er ) const; int GetRowSize( EditMenuRow er ) const;
int m_iSelection[NUM_EDIT_MENU_ROWS]; int m_iSelection[NUM_EditMenuRow];
BitmapText m_textLabel[NUM_EDIT_MENU_ROWS]; BitmapText m_textLabel[NUM_EditMenuRow];
BitmapText m_textValue[NUM_EDIT_MENU_ROWS]; BitmapText m_textValue[NUM_EditMenuRow];
FadingBanner m_GroupBanner; FadingBanner m_GroupBanner;
FadingBanner m_SongBanner; FadingBanner m_SongBanner;
-13
View File
@@ -68,19 +68,6 @@ static const CString EMPTY_STRING;
return *as_##X##Name[x]; \ return *as_##X##Name[x]; \
} }
#define XToThemedString(X, CNT) \
static ThemeMetric<CString> g_##X##Name[CNT]; \
const CString &X##ToThemedString( X x ) \
{ \
static bool bInitted = false; \
if( !bInitted ) { \
bInitted = true; \
for( unsigned i = 0; i < CNT; ++i ) \
g_##X##Name[i].Load( #X, X##ToString((X)i) ); \
} \
return g_##X##Name[x]; \
}
#define XToLocalizedString(X) \ #define XToLocalizedString(X) \
const CString &X##ToLocalizedString( X x ) \ const CString &X##ToLocalizedString( X x ) \
{ \ { \
+17 -16
View File
@@ -10,6 +10,7 @@
#include <float.h> #include <float.h>
#include "LuaFunctions.h" #include "LuaFunctions.h"
#include "LocalizedString.h"
const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"}; const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"};
@@ -28,9 +29,9 @@ static const char *RadarCategoryNames[] = {
"Hands", "Hands",
"Rolls" "Rolls"
}; };
XToString( RadarCategory, NUM_RADAR_CATEGORIES ); XToString( RadarCategory, NUM_RadarCategory );
XToThemedString( RadarCategory, NUM_RADAR_CATEGORIES ); XToLocalizedString( RadarCategory );
LuaFunction( RadarCategoryToThemedString, RadarCategoryToThemedString((RadarCategory) IArg(1)) ); LuaFunction( RadarCategoryToLocalizedString, RadarCategoryToLocalizedString((RadarCategory) IArg(1)) );
static void LuaRadarCategory(lua_State* L) static void LuaRadarCategory(lua_State* L)
{ {
@@ -64,12 +65,12 @@ static const char *PlayModeNames[] = {
"Battle", "Battle",
"Rave", "Rave",
}; };
XToString( PlayMode, NUM_PLAY_MODES ); XToString( PlayMode, NUM_PlayMode );
XToThemedString( PlayMode, NUM_PLAY_MODES ); XToLocalizedString( PlayMode );
StringToX( PlayMode ); StringToX( PlayMode );
LuaXToString( PlayMode ); LuaXToString( PlayMode );
LuaFunction( PlayModeToThemedString, PlayModeToThemedString((PlayMode) IArg(1)) ); LuaFunction( PlayModeToLocalizedString, PlayModeToLocalizedString((PlayMode) IArg(1)) );
LuaXType( PlayMode, NUM_PLAY_MODES, "PLAY_MODE_", true ) LuaXType( PlayMode, NUM_PlayMode, "PLAY_MODE_", true )
RankingCategory AverageMeterToRankingCategory( int iAverageMeter ) RankingCategory AverageMeterToRankingCategory( int iAverageMeter )
{ {
@@ -214,8 +215,8 @@ TapNoteScore StringToTapNoteScore( const CString &s )
return TNS_INVALID; return TNS_INVALID;
} }
XToThemedString( TapNoteScore, NUM_TapNoteScore ); XToLocalizedString( TapNoteScore );
LuaFunction( TapNoteScoreToThemedString, TapNoteScoreToThemedString((TapNoteScore) IArg(1)) ); LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString((TapNoteScore) IArg(1)) );
static void LuaTapNoteScores( lua_State* L ) static void LuaTapNoteScores( lua_State* L )
{ {
FOREACH_TapNoteScore( i ) FOREACH_TapNoteScore( i )
@@ -246,7 +247,7 @@ HoldNoteScore StringToHoldNoteScore( const CString &s )
return HNS_INVALID; return HNS_INVALID;
} }
XToThemedString( HoldNoteScore, NUM_HoldNoteScore ); XToLocalizedString( HoldNoteScore );
static void LuaHoldNoteScores( lua_State* L ) static void LuaHoldNoteScores( lua_State* L )
{ {
FOREACH_HoldNoteScore( i ) FOREACH_HoldNoteScore( i )
@@ -281,10 +282,10 @@ static const char *PerDifficultyAwardNames[] = {
"Percent90W3", "Percent90W3",
"Percent100W3", "Percent100W3",
}; };
XToString( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS ); XToString( PerDifficultyAward, NUM_PerDifficultyAward );
XToThemedString( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS ); XToLocalizedString( PerDifficultyAward );
StringToX( PerDifficultyAward ); StringToX( PerDifficultyAward );
LuaFunction( PerDifficultyAwardToThemedString, PerDifficultyAwardToThemedString((PerDifficultyAward) IArg(1)) ); LuaFunction( PerDifficultyAwardToLocalizedString, PerDifficultyAwardToLocalizedString((PerDifficultyAward) IArg(1)) );
static void LuaPerDifficultyAward( lua_State* L ) static void LuaPerDifficultyAward( lua_State* L )
{ {
FOREACH_PerDifficultyAward( i ) FOREACH_PerDifficultyAward( i )
@@ -308,10 +309,10 @@ static const char *PeakComboAwardNames[] = {
"Peak9000Combo", "Peak9000Combo",
"Peak10000Combo", "Peak10000Combo",
}; };
XToString( PeakComboAward, NUM_PEAK_COMBO_AWARDS ); XToString( PeakComboAward, NUM_PeakComboAward );
XToThemedString( PeakComboAward, NUM_PEAK_COMBO_AWARDS ); XToLocalizedString( PeakComboAward );
StringToX( PeakComboAward ); StringToX( PeakComboAward );
LuaFunction( PeakComboAwardToThemedString, PeakComboAwardToThemedString((PeakComboAward) IArg(1)) ); LuaFunction( PeakComboAwardToLocalizedString, PeakComboAwardToLocalizedString((PeakComboAward) IArg(1)) );
static void LuaPeakComboAward( lua_State* L ) static void LuaPeakComboAward( lua_State* L )
{ {
FOREACH_PeakComboAward( i ) FOREACH_PeakComboAward( i )
+14 -14
View File
@@ -29,11 +29,11 @@ enum RadarCategory
RadarCategory_Mines, RadarCategory_Mines,
RadarCategory_Hands, RadarCategory_Hands,
RadarCategory_Rolls, RadarCategory_Rolls,
NUM_RADAR_CATEGORIES // leave this at the end NUM_RadarCategory // leave this at the end
}; };
#define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RADAR_CATEGORIES, rc ) #define FOREACH_RadarCategory( rc ) FOREACH_ENUM( RadarCategory, NUM_RadarCategory, rc )
const CString& RadarCategoryToString( RadarCategory cat ); const CString& RadarCategoryToString( RadarCategory cat );
const CString& RadarCategoryToThemedString( RadarCategory cat ); const CString& RadarCategoryToLocalizedString( RadarCategory cat );
enum StepsType enum StepsType
@@ -82,12 +82,12 @@ enum PlayMode
PLAY_MODE_ENDLESS, PLAY_MODE_ENDLESS,
PLAY_MODE_BATTLE, // manually launched attacks PLAY_MODE_BATTLE, // manually launched attacks
PLAY_MODE_RAVE, // automatically launched attacks PLAY_MODE_RAVE, // automatically launched attacks
NUM_PLAY_MODES, NUM_PlayMode,
PLAY_MODE_INVALID PLAY_MODE_INVALID
}; };
#define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PLAY_MODES, pm ) #define FOREACH_PlayMode( pm ) FOREACH_ENUM( PlayMode, NUM_PlayMode, pm )
const CString& PlayModeToString( PlayMode pm ); const CString& PlayModeToString( PlayMode pm );
const CString& PlayModeToThemedString( PlayMode pm ); const CString& PlayModeToLocalizedString( PlayMode pm );
PlayMode StringToPlayMode( const CString& s ); PlayMode StringToPlayMode( const CString& s );
@@ -142,7 +142,7 @@ enum TapNoteScore {
}; };
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TapNoteScore, tns ) #define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TapNoteScore, tns )
const CString& TapNoteScoreToString( TapNoteScore tns ); const CString& TapNoteScoreToString( TapNoteScore tns );
const CString& TapNoteScoreToThemedString( TapNoteScore tns ); const CString& TapNoteScoreToLocalizedString( TapNoteScore tns );
TapNoteScore StringToTapNoteScore( const CString& str ); TapNoteScore StringToTapNoteScore( const CString& str );
@@ -156,7 +156,7 @@ enum HoldNoteScore
}; };
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HoldNoteScore, hns ) #define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HoldNoteScore, hns )
const CString& HoldNoteScoreToString( HoldNoteScore hns ); const CString& HoldNoteScoreToString( HoldNoteScore hns );
const CString& HoldNoteScoreToThemedString( HoldNoteScore hns ); const CString& HoldNoteScoreToLocalizedString( HoldNoteScore hns );
HoldNoteScore StringToHoldNoteScore( const CString& str ); HoldNoteScore StringToHoldNoteScore( const CString& str );
@@ -333,12 +333,12 @@ enum PerDifficultyAward
AWARD_PERCENT_80_W3, AWARD_PERCENT_80_W3,
AWARD_PERCENT_90_W3, AWARD_PERCENT_90_W3,
AWARD_PERCENT_100_W3, AWARD_PERCENT_100_W3,
NUM_PER_DIFFICULTY_AWARDS, NUM_PerDifficultyAward,
PER_DIFFICULTY_AWARD_INVALID, PER_DIFFICULTY_AWARD_INVALID,
}; };
#define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS, pma ) #define FOREACH_PerDifficultyAward( pma ) FOREACH_ENUM( PerDifficultyAward, NUM_PerDifficultyAward, pma )
const CString& PerDifficultyAwardToString( PerDifficultyAward pma ); const CString& PerDifficultyAwardToString( PerDifficultyAward pma );
const CString& PerDifficultyAwardToThemedString( PerDifficultyAward pma ); const CString& PerDifficultyAwardToLocalizedString( PerDifficultyAward pma );
PerDifficultyAward StringToPerDifficultyAward( const CString& pma ); PerDifficultyAward StringToPerDifficultyAward( const CString& pma );
@@ -354,12 +354,12 @@ enum PeakComboAward
AWARD_8000_PEAK_COMBO, AWARD_8000_PEAK_COMBO,
AWARD_9000_PEAK_COMBO, AWARD_9000_PEAK_COMBO,
AWARD_10000_PEAK_COMBO, AWARD_10000_PEAK_COMBO,
NUM_PEAK_COMBO_AWARDS, NUM_PeakComboAward,
PEAK_COMBO_AWARD_INVALID, PEAK_COMBO_AWARD_INVALID,
}; };
#define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PEAK_COMBO_AWARDS, pca ) #define FOREACH_PeakComboAward( pca ) FOREACH_ENUM( PeakComboAward, NUM_PeakComboAward, pca )
const CString& PeakComboAwardToString( PeakComboAward pma ); const CString& PeakComboAwardToString( PeakComboAward pma );
const CString& PeakComboAwardToThemedString( PeakComboAward pma ); const CString& PeakComboAwardToLocalizedString( PeakComboAward pma );
PeakComboAward StringToPeakComboAward( const CString& pma ); PeakComboAward StringToPeakComboAward( const CString& pma );
+4 -4
View File
@@ -2750,7 +2750,7 @@ CString GameManager::StepsTypeToString( StepsType st )
return StepsTypes[st].name; return StepsTypes[st].name;
} }
CString GameManager::StepsTypeToThemedString( StepsType st ) CString GameManager::StepsTypeToLocalizedString( StepsType st )
{ {
CString s = StepsTypeToString( st ); CString s = StepsTypeToString( st );
if( THEME->HasMetric( "StepsType", s ) ) if( THEME->HasMetric( "StepsType", s ) )
@@ -2759,7 +2759,7 @@ CString GameManager::StepsTypeToThemedString( StepsType st )
return s; return s;
} }
CString GameManager::StyleToThemedString( const Style* style ) CString GameManager::StyleToLocalizedString( const Style* style )
{ {
CString s = style->m_szName; CString s = style->m_szName;
s = Capitalize( s ); s = Capitalize( s );
@@ -2854,7 +2854,7 @@ class LunaGameManager: public Luna<GameManager>
public: public:
LunaGameManager() { LUA->Register( Register ); } LunaGameManager() { LUA->Register( Register ); }
static int StepsTypeToThemedString( T* p, lua_State *L ) { lua_pushstring(L, p->StepsTypeToThemedString((StepsType)IArg(1)) ); return 1; } static int StepsTypeToLocalizedString( T* p, lua_State *L ) { lua_pushstring(L, p->StepsTypeToLocalizedString((StepsType)IArg(1)) ); return 1; }
static int GetFirstStepsTypeForCurrentGame( T* p, lua_State *L ) static int GetFirstStepsTypeForCurrentGame( T* p, lua_State *L )
{ {
vector<StepsType> vstAddTo; vector<StepsType> vstAddTo;
@@ -2867,7 +2867,7 @@ public:
static void Register(lua_State *L) static void Register(lua_State *L)
{ {
ADD_METHOD( StepsTypeToThemedString ); ADD_METHOD( StepsTypeToLocalizedString );
ADD_METHOD( GetFirstStepsTypeForCurrentGame ); ADD_METHOD( GetFirstStepsTypeForCurrentGame );
Luna<T>::Register( L ); Luna<T>::Register( L );
+2 -2
View File
@@ -31,10 +31,10 @@ public:
static int StepsTypeToNumTracks( StepsType st ); static int StepsTypeToNumTracks( StepsType st );
static StepsType StringToStepsType( CString sStepsType ); static StepsType StringToStepsType( CString sStepsType );
static CString StepsTypeToString( StepsType st ); static CString StepsTypeToString( StepsType st );
static CString StepsTypeToThemedString( StepsType st ); static CString StepsTypeToLocalizedString( StepsType st );
static const Game* StringToGameType( CString sGameType ); static const Game* StringToGameType( CString sGameType );
const Style* GameAndStringToStyle( const Game* pGame, CString sStyle ); const Style* GameAndStringToStyle( const Game* pGame, CString sStyle );
static CString StyleToThemedString( const Style* s ); static CString StyleToLocalizedString( const Style* s );
CString GetMenuButtonSecondaryFunction( const Game *pGame, GameButton gb ) const; CString GetMenuButtonSecondaryFunction( const Game *pGame, GameButton gb ) const;
// Lua // Lua
+4 -4
View File
@@ -1519,7 +1519,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
feat.pCourse = pCourse; feat.pCourse = pCourse;
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() ); feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() );
if( cd != DIFFICULTY_MEDIUM ) if( cd != DIFFICULTY_MEDIUM )
feat.Feat += " " + CourseDifficultyToThemedString(cd); feat.Feat += " " + CourseDifficultyToLocalizedString(cd);
feat.pStringToFill = hs.GetNameMutable(); feat.pStringToFill = hs.GetNameMutable();
feat.grade = Grade_NoData; feat.grade = Grade_NoData;
feat.iScore = hs.GetScore(); feat.iScore = hs.GetScore();
@@ -1735,7 +1735,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir )
while( 1 ) while( 1 )
{ {
d = (Difficulty)(d+dir); d = (Difficulty)(d+dir);
if( d < 0 || d >= NUM_DIFFICULTIES ) if( d < 0 || d >= NUM_Difficulty )
return false; return false;
if( find(v.begin(), v.end(), d) != v.end() ) if( find(v.begin(), v.end(), d) != v.end() )
break; // found break; // found
@@ -1767,7 +1767,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
while( 1 ) while( 1 )
{ {
cd = (CourseDifficulty)(cd+dir); cd = (CourseDifficulty)(cd+dir);
if( cd < 0 || cd >= NUM_DIFFICULTIES ) if( cd < 0 || cd >= NUM_Difficulty )
return false; return false;
if( find(v.begin(),v.end(),cd) == v.end() ) if( find(v.begin(),v.end(),cd) == v.end() )
continue; /* not available */ continue; /* not available */
@@ -2103,7 +2103,7 @@ public:
for( unsigned i=0; i<vpStepsToShow.size(); i++ ) for( unsigned i=0; i<vpStepsToShow.size(); i++ )
{ {
const Steps* pSteps = vpStepsToShow[i]; const Steps* pSteps = vpStepsToShow[i];
CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() ); CString sDifficulty = DifficultyToLocalizedString( pSteps->GetDifficulty() );
// HACK: reset capitalization // HACK: reset capitalization
sDifficulty.MakeLower(); sDifficulty.MakeLower();
+1 -1
View File
@@ -9,7 +9,7 @@
LuaFunction( GradeToString, GradeToString((Grade)IArg(1)) ) LuaFunction( GradeToString, GradeToString((Grade)IArg(1)) )
CString GradeToThemedString( Grade g ) CString GradeToLocalizedString( Grade g )
{ {
CString s = GradeToString(g); CString s = GradeToString(g);
if( !THEME->HasMetric("Grade",s) ) if( !THEME->HasMetric("Grade",s) )
+1 -1
View File
@@ -49,7 +49,7 @@ static inline CString GradeToString( Grade g )
} }
CString GradeToOldString( Grade g ); // "AAA", "B", etc for backward compatibility. Used in announcer CString GradeToOldString( Grade g ); // "AAA", "B", etc for backward compatibility. Used in announcer
CString GradeToThemedString( Grade g ); CString GradeToLocalizedString( Grade g );
Grade StringToGrade( const CString &s ); Grade StringToGrade( const CString &s );
#define FOREACH_Grade( g ) FOREACH_ENUM( Grade, NUM_Grade, g ) #define FOREACH_Grade( g ) FOREACH_ENUM( Grade, NUM_Grade, g )
#define FOREACH_UsedGrade( g ) FOREACH_ENUM( Grade, THEME->GetMetricI("PlayerStageStats","NumGradeTiersUsed"), g ) #define FOREACH_UsedGrade( g ) FOREACH_ENUM( Grade, THEME->GetMetricI("PlayerStageStats","NumGradeTiersUsed"), g )
+3 -3
View File
@@ -45,15 +45,15 @@ protected:
bool m_bValuesVisible; bool m_bValuesVisible;
float m_PercentTowardNew; float m_PercentTowardNew;
float m_fValuesNew[NUM_RADAR_CATEGORIES]; float m_fValuesNew[NUM_RadarCategory];
float m_fValuesOld[NUM_RADAR_CATEGORIES]; float m_fValuesOld[NUM_RadarCategory];
PlayerNumber m_PlayerNumber; PlayerNumber m_PlayerNumber;
}; };
Sprite m_sprRadarBase; Sprite m_sprRadarBase;
GrooveRadarValueMap m_GrooveRadarValueMap[NUM_PLAYERS]; GrooveRadarValueMap m_GrooveRadarValueMap[NUM_PLAYERS];
Sprite m_sprRadarLabels[NUM_RADAR_CATEGORIES]; Sprite m_sprRadarLabels[NUM_RadarCategory];
ActorFrame m_Frame; ActorFrame m_Frame;
}; };
+18 -5
View File
@@ -29,14 +29,15 @@ RString LocalizedString::LocalizeString( const RString &sSection, const RString
return g_pfnLocalizer( sSection, sName ); return g_pfnLocalizer( sSection, sName );
} }
LocalizedString::LocalizedString()
{
g_Subscribers.Subscribe( this );
}
LocalizedString::LocalizedString( const RString &sSection, const RString &sName ) LocalizedString::LocalizedString( const RString &sSection, const RString &sName )
{ {
m_sSection = sSection; Load( sSection, sName );
m_sName = sName;
m_sValue = sName;
g_Subscribers.Subscribe( this ); g_Subscribers.Subscribe( this );
Refresh(); Refresh();
} }
@@ -46,6 +47,12 @@ LocalizedString::~LocalizedString()
g_Subscribers.Unsubscribe( this ); g_Subscribers.Unsubscribe( this );
} }
void LocalizedString::Load( const RString &sSection, const RString &sName )
{
m_sSection = sSection;
m_sName = sName;
m_sValue = sName;
}
LocalizedString::operator RString() const LocalizedString::operator RString() const
{ {
@@ -54,6 +61,7 @@ LocalizedString::operator RString() const
const RString &LocalizedString::GetValue() const const RString &LocalizedString::GetValue() const
{ {
ASSERT( IsLoaded() );
return m_sValue; return m_sValue;
} }
@@ -62,6 +70,11 @@ void LocalizedString::Refresh()
m_sValue = LocalizeString( m_sSection, m_sName ); m_sValue = LocalizeString( m_sSection, m_sName );
} }
bool LocalizedString::IsLoaded() const
{
return !m_sSection.empty() && !m_sName.empty();
}
LuaFunction( LocalizeString, LocalizedString::LocalizeString( SArg(1), SArg(2) ) ) LuaFunction( LocalizeString, LocalizedString::LocalizeString( SArg(1), SArg(2) ) )
/* /*
+3
View File
@@ -11,11 +11,14 @@ public:
static RString LocalizeString( const RString &sSection, const RString &sName ); static RString LocalizeString( const RString &sSection, const RString &sName );
LocalizedString();
LocalizedString( const RString &sSection, const RString &sName ); LocalizedString( const RString &sSection, const RString &sName );
~LocalizedString(); ~LocalizedString();
void Load( const RString &sSection, const RString &sName );
void Refresh(); void Refresh();
operator RString() const; operator RString() const;
const RString &GetValue() const; const RString &GetValue() const;
bool IsLoaded() const;
private: private:
RString m_sSection; RString m_sSection;
RString m_sName; RString m_sName;
+1 -1
View File
@@ -49,7 +49,7 @@ void SMLoader::LoadFromSMTokens(
out.SetMeter(atoi(sMeter)); out.SetMeter(atoi(sMeter));
vector<CString> saValues; vector<CString> saValues;
split( sRadarValues, ",", saValues, true ); split( sRadarValues, ",", saValues, true );
if( saValues.size() == NUM_RADAR_CATEGORIES ) if( saValues.size() == NUM_RadarCategory )
{ {
RadarValues v; RadarValues v;
FOREACH_RadarCategory(rc) FOREACH_RadarCategory(rc)
+1 -1
View File
@@ -169,7 +169,7 @@ CString NotesWriterSM::GetSMNotesTag( const Song &song, const Steps &in, bool bS
lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) ); lines.push_back( ssprintf( " %s:", DifficultyToString(in.GetDifficulty()).c_str() ) );
lines.push_back( ssprintf( " %d:", in.GetMeter() ) ); lines.push_back( ssprintf( " %d:", in.GetMeter() ) );
int MaxRadar = bSavingCache? NUM_RADAR_CATEGORIES:5; int MaxRadar = bSavingCache? NUM_RadarCategory:5;
vector<CString> asRadarValues; vector<CString> asRadarValues;
for( int r=0; r < MaxRadar; r++ ) for( int r=0; r < MaxRadar; r++ )
asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) ); asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) );
+6 -6
View File
@@ -317,7 +317,7 @@ public:
{ {
Trail* pTrail = vTrails[i]; Trail* pTrail = vTrails[i];
CString s = CourseDifficultyToThemedString( pTrail->m_CourseDifficulty ); CString s = CourseDifficultyToLocalizedString( pTrail->m_CourseDifficulty );
s += ssprintf( " %d", pTrail->GetMeter() ); s += ssprintf( " %d", pTrail->GetMeter() );
defOut.m_vsChoices.push_back( s ); defOut.m_vsChoices.push_back( s );
GameCommand mc; GameCommand mc;
@@ -340,7 +340,7 @@ public:
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( pSteps->GetDifficulty() == DIFFICULTY_EDIT )
s = pSteps->GetDescription(); s = pSteps->GetDescription();
else else
s = DifficultyToThemedString( pSteps->GetDifficulty() ); s = DifficultyToLocalizedString( pSteps->GetDifficulty() );
s += ssprintf( " %d", pSteps->GetMeter() ); s += ssprintf( " %d", pSteps->GetMeter() );
defOut.m_vsChoices.push_back( s ); defOut.m_vsChoices.push_back( s );
GameCommand mc; GameCommand mc;
@@ -401,7 +401,7 @@ public:
ASSERT( vStyles.size() ); ASSERT( vStyles.size() );
FOREACH_CONST( const Style*, vStyles, s ) FOREACH_CONST( const Style*, vStyles, s )
{ {
defOut.m_vsChoices.push_back( GAMEMAN->StyleToThemedString(*s) ); defOut.m_vsChoices.push_back( GAMEMAN->StyleToLocalizedString(*s) );
GameCommand mc; GameCommand mc;
mc.m_pStyle = *s; mc.m_pStyle = *s;
ListEntries.push_back( mc ); ListEntries.push_back( mc );
@@ -463,7 +463,7 @@ public:
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d ) FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d )
{ {
CString s = DifficultyToThemedString( *d ); CString s = DifficultyToLocalizedString( *d );
defOut.m_vsChoices.push_back( s ); defOut.m_vsChoices.push_back( s );
GameCommand mc; GameCommand mc;
@@ -950,7 +950,7 @@ public:
FOREACH_CONST( StepsType, m_vStepsTypesToShow, st ) FOREACH_CONST( StepsType, m_vStepsTypesToShow, st )
{ {
CString s = GAMEMAN->StepsTypeToThemedString( *st ); CString s = GAMEMAN->StepsTypeToLocalizedString( *st );
defOut.m_vsChoices.push_back( s ); defOut.m_vsChoices.push_back( s );
} }
@@ -1085,7 +1085,7 @@ public:
} }
else else
{ {
s = DifficultyToThemedString( dc ); s = DifficultyToLocalizedString( dc );
} }
defOut.m_vsChoices.push_back( s ); defOut.m_vsChoices.push_back( s );
} }
+3 -2
View File
@@ -11,6 +11,7 @@
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
class XNode; class XNode;
#include "LocalizedString.h"
enum PaneTypes enum PaneTypes
{ {
@@ -75,8 +76,8 @@ private:
PaneTypes m_CurPane; PaneTypes m_CurPane;
PlayerNumber m_PlayerNumber; PlayerNumber m_PlayerNumber;
ThemeMetric<CString> EMPTY_MACHINE_HIGH_SCORE_NAME; LocalizedString EMPTY_MACHINE_HIGH_SCORE_NAME;
ThemeMetric<CString> NOT_AVAILABLE; LocalizedString NOT_AVAILABLE;
}; };
#endif #endif
+3 -3
View File
@@ -2,14 +2,14 @@
#include "PlayerNumber.h" #include "PlayerNumber.h"
#include "GameState.h" #include "GameState.h"
#include "LuaManager.h" #include "LuaManager.h"
#include "ThemeMetric.h" #include "LocalizedString.h"
static const char *PlayerNumberNames[] = { static const char *PlayerNumberNames[] = {
"P1", "P1",
"P2", "P2",
}; };
XToString( PlayerNumber, NUM_PLAYERS ); XToString( PlayerNumber, NUM_PLAYERS );
XToThemedString( PlayerNumber, NUM_PLAYERS ); XToLocalizedString( PlayerNumber );
void LuaPlayerNumber(lua_State* L) void LuaPlayerNumber(lua_State* L)
{ {
@@ -31,7 +31,7 @@ static const char *MultiPlayerNames[] = {
"P8", "P8",
}; };
XToString( MultiPlayer, NUM_MultiPlayer ); XToString( MultiPlayer, NUM_MultiPlayer );
XToThemedString( MultiPlayer, NUM_MultiPlayer ); XToLocalizedString( MultiPlayer );
PlayerNumber GetNextHumanPlayer( PlayerNumber pn ) PlayerNumber GetNextHumanPlayer( PlayerNumber pn )
+4 -3
View File
@@ -13,11 +13,12 @@ enum PlayerNumber
{ {
PLAYER_1 = 0, PLAYER_1 = 0,
PLAYER_2, PLAYER_2,
NUM_PLAYERS, // leave this at the end NUM_PlayerNumber, // leave this at the end
PLAYER_INVALID PLAYER_INVALID
}; };
const int NUM_PLAYERS = NUM_PlayerNumber;
const CString& PlayerNumberToString( PlayerNumber pn ); const CString& PlayerNumberToString( PlayerNumber pn );
const CString& PlayerNumberToThemedString( PlayerNumber pn ); const CString& PlayerNumberToLocalizedString( PlayerNumber pn );
#define FOREACH_PlayerNumber( pn ) FOREACH_ENUM( PlayerNumber, NUM_PLAYERS, pn ) #define FOREACH_PlayerNumber( pn ) FOREACH_ENUM( PlayerNumber, NUM_PLAYERS, pn )
#define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) ) #define FOREACH_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) )
@@ -47,7 +48,7 @@ enum MultiPlayer
MultiPlayer_INVALID MultiPlayer_INVALID
}; };
const CString& MultiPlayerToString( MultiPlayer mp ); const CString& MultiPlayerToString( MultiPlayer mp );
const CString& MultiPlayerToThemedString( MultiPlayer mp ); const CString& MultiPlayerToLocalizedString( MultiPlayer mp );
#define FOREACH_MultiPlayer( pn ) FOREACH_ENUM( MultiPlayer, NUM_MultiPlayer, pn ) #define FOREACH_MultiPlayer( pn ) FOREACH_ENUM( MultiPlayer, NUM_MultiPlayer, pn )
+3 -3
View File
@@ -137,13 +137,13 @@ public:
mutable DateTime m_LastPlayedDate; mutable DateTime m_LastPlayedDate;
/* These stats count twice in the machine profile if two players are playing; /* These stats count twice in the machine profile if two players are playing;
* that's the only approach that makes sense for ByDifficulty and ByMeter. */ * that's the only approach that makes sense for ByDifficulty and ByMeter. */
int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES]; int m_iNumSongsPlayedByPlayMode[NUM_PlayMode];
map<StyleID,int> m_iNumSongsPlayedByStyle; map<StyleID,int> m_iNumSongsPlayedByStyle;
int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES]; int m_iNumSongsPlayedByDifficulty[NUM_Difficulty];
int m_iNumSongsPlayedByMeter[MAX_METER+1]; int m_iNumSongsPlayedByMeter[MAX_METER+1];
/* This stat counts once per song, even if two players are active. */ /* This stat counts once per song, even if two players are active. */
int m_iNumTotalSongsPlayed; int m_iNumTotalSongsPlayed;
int m_iNumStagesPassedByPlayMode[NUM_PLAY_MODES]; int m_iNumStagesPassedByPlayMode[NUM_PlayMode];
int m_iNumStagesPassedByGrade[NUM_Grade]; int m_iNumStagesPassedByGrade[NUM_Grade];
// //
+3 -3
View File
@@ -63,8 +63,8 @@ void RadarValues::LoadFromNode( const XNode* pNode )
CString RadarValues::ToString( int iMaxValues ) const CString RadarValues::ToString( int iMaxValues ) const
{ {
if( iMaxValues == -1 ) if( iMaxValues == -1 )
iMaxValues = NUM_RADAR_CATEGORIES; iMaxValues = NUM_RadarCategory;
iMaxValues = min( iMaxValues, (int)NUM_RADAR_CATEGORIES ); iMaxValues = min( iMaxValues, (int)NUM_RadarCategory );
vector<CString> asRadarValues; vector<CString> asRadarValues;
for( int r=0; r < iMaxValues; r++ ) for( int r=0; r < iMaxValues; r++ )
@@ -78,7 +78,7 @@ void RadarValues::FromString( CString sRadarValues )
vector<CString> saValues; vector<CString> saValues;
split( sRadarValues, ",", saValues, true ); split( sRadarValues, ",", saValues, true );
if( saValues.size() != NUM_RADAR_CATEGORIES ) if( saValues.size() != NUM_RadarCategory )
{ {
MakeUnknown(); MakeUnknown();
return; return;
+1 -1
View File
@@ -27,7 +27,7 @@ struct RadarValues
float fNumHands; float fNumHands;
float fNumRolls; float fNumRolls;
} v; } v;
float f[NUM_RADAR_CATEGORIES]; float f[NUM_RadarCategory];
} m_Values; } m_Values;
operator const float* () const { return m_Values.f; }; operator const float* () const { return m_Values.f; };
+4 -4
View File
@@ -134,7 +134,7 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle, sData; CString sTitle, sData;
for( int i=0; i<NUM_LAST_DAYS; i++ ) for( int i=0; i<NUM_LAST_DAYS; i++ )
{ {
sTitle += LastDayToThemedString(i) + "\n"; sTitle += LastDayToLocalizedString(i) + "\n";
sData += ssprintf("%d",coins[i]) + "\n"; sData += ssprintf("%d",coins[i]) + "\n";
iTotalLast += coins[i]; iTotalLast += coins[i];
} }
@@ -164,7 +164,7 @@ void ScreenBookkeeping::ChangeView( View newView )
for( int row=0; row<52/4; row++ ) for( int row=0; row<52/4; row++ )
{ {
int week = row*4+col; int week = row*4+col;
sTemp += LastWeekToThemedString(week) + ssprintf(": %d",coins[week]) + "\n"; sTemp += LastWeekToLocalizedString(week) + ssprintf(": %d",coins[week]) + "\n";
} }
m_textData[col].SetHorizAlign( Actor::align_left ); m_textData[col].SetHorizAlign( Actor::align_left );
@@ -204,14 +204,14 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle1, sData1; CString sTitle1, sData1;
for( int i=0; i<HOURS_IN_DAY/2; i++ ) for( int i=0; i<HOURS_IN_DAY/2; i++ )
{ {
sTitle1 += HourInDayToThemedString(i) + "\n"; sTitle1 += HourInDayToLocalizedString(i) + "\n";
sData1 += ssprintf("%d",coins[i]) + "\n"; sData1 += ssprintf("%d",coins[i]) + "\n";
} }
CString sTitle2, sData2; CString sTitle2, sData2;
for( int i=(HOURS_IN_DAY/2); i<HOURS_IN_DAY; i++ ) for( int i=(HOURS_IN_DAY/2); i<HOURS_IN_DAY; i++ )
{ {
sTitle2 += HourInDayToThemedString(i) + "\n"; sTitle2 += HourInDayToLocalizedString(i) + "\n";
sData2 += ssprintf("%d",coins[i]) + "\n"; sData2 += ssprintf("%d",coins[i]) + "\n";
} }
+1 -1
View File
@@ -2542,7 +2542,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
g_StepsInformation.rows[difficulty].choices.clear(); g_StepsInformation.rows[difficulty].choices.clear();
FOREACH_Difficulty( dc ) FOREACH_Difficulty( dc )
g_StepsInformation.rows[difficulty].choices.push_back( "|" + DifficultyToThemedString(pSteps->GetDifficulty()) ); g_StepsInformation.rows[difficulty].choices.push_back( "|" + DifficultyToLocalizedString(pSteps->GetDifficulty()) );
g_StepsInformation.rows[difficulty].iDefaultChoice = pSteps->GetDifficulty(); g_StepsInformation.rows[difficulty].iDefaultChoice = pSteps->GetDifficulty();
g_StepsInformation.rows[difficulty].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full); g_StepsInformation.rows[difficulty].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full);
g_StepsInformation.rows[meter].iDefaultChoice = clamp( pSteps->GetMeter()-1, 0, MAX_METER+1 ); g_StepsInformation.rows[meter].iDefaultChoice = clamp( pSteps->GetMeter()-1, 0, MAX_METER+1 );
+1 -1
View File
@@ -139,7 +139,7 @@ static CString GetCopyDescription( const Steps *pSourceSteps )
if( pSourceSteps->GetDifficulty() == DIFFICULTY_EDIT ) if( pSourceSteps->GetDifficulty() == DIFFICULTY_EDIT )
s = pSourceSteps->GetDescription(); s = pSourceSteps->GetDescription();
else else
s = DifficultyToThemedString( pSourceSteps->GetDifficulty() ); s = DifficultyToLocalizedString( pSourceSteps->GetDifficulty() );
return s; return s;
} }
+10 -10
View File
@@ -30,7 +30,7 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line )
case PERCENT_COMPLETE: case PERCENT_COMPLETE:
{ {
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType; StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st); CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st);
CString sType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs"; CString sType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs";
return ssprintf( "%s %s %%", sStepsType.c_str(), sType.c_str() ); return ssprintf( "%s %s %%", sStepsType.c_str(), sType.c_str() );
} }
@@ -42,16 +42,16 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line )
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
{ {
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES ); ASSERT( cd >= 0 && cd < NUM_CourseDifficulty );
if( !GAMESTATE->IsCourseDifficultyShown(cd) ) if( !GAMESTATE->IsCourseDifficultyShown(cd) )
return CString(); return CString();
return CourseDifficultyToThemedString(cd); return CourseDifficultyToLocalizedString(cd);
} }
else else
{ {
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES ); ASSERT( dc >= 0 && dc < NUM_Difficulty );
return DifficultyToThemedString(dc); return DifficultyToLocalizedString(dc);
} }
} }
default: ASSERT(0); return CString(); default: ASSERT(0); return CString();
@@ -101,22 +101,22 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
case PERCENT_COMPLETE_CHALLENGE: case PERCENT_COMPLETE_CHALLENGE:
// Ugly... // Ugly...
{ {
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st); CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st);
float fPercent = 0; float fPercent = 0;
if( GAMESTATE->IsCourseMode() ) if( GAMESTATE->IsCourseMode() )
{ {
CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); CourseDifficulty cd = (CourseDifficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( cd >= 0 && cd < NUM_COURSE_DIFFICULTIES ); ASSERT( cd >= 0 && cd < NUM_CourseDifficulty );
if( !GAMESTATE->IsCourseDifficultyShown(cd) ) if( !GAMESTATE->IsCourseDifficultyShown(cd) )
return CString(); return CString();
CString sDifficulty = CourseDifficultyToThemedString(cd); CString sDifficulty = CourseDifficultyToLocalizedString(cd);
fPercent = pProfile->GetCoursesPercentComplete(st,cd); fPercent = pProfile->GetCoursesPercentComplete(st,cd);
} }
else else
{ {
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY); Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES ); ASSERT( dc >= 0 && dc < NUM_Difficulty );
CString sDifficulty = DifficultyToThemedString(dc); CString sDifficulty = DifficultyToLocalizedString(dc);
fPercent = pProfile->GetSongsPercentComplete(st,dc); fPercent = pProfile->GetSongsPercentComplete(st,dc);
} }
return ssprintf( "%05.2f%%", fPercent*100 ); return ssprintf( "%05.2f%%", fPercent*100 );
+1 -1
View File
@@ -206,7 +206,7 @@ void ScreenEvaluation::Init()
// //
{ {
FOREACH_PlayerNumber( p ) // foreach line FOREACH_PlayerNumber( p ) // foreach line
for( int r=0; r<NUM_RADAR_CATEGORIES; r++ ) // foreach line for( int r=0; r<NUM_RadarCategory; r++ ) // foreach line
{ {
STATSMAN->m_CurStageStats.radarPossible[p][r] = 0.5f + r/10.0f; STATSMAN->m_CurStageStats.radarPossible[p][r] = 0.5f + r/10.0f;
STATSMAN->m_CurStageStats.radarActual[p][r] = 0.5f + r/10.0f; STATSMAN->m_CurStageStats.radarActual[p][r] = 0.5f + r/10.0f;
+2 -2
View File
@@ -76,8 +76,8 @@ protected:
// bonus area // bonus area
AutoActor m_sprBonusFrame[NUM_PLAYERS]; AutoActor m_sprBonusFrame[NUM_PLAYERS];
Sprite m_sprPossibleBar[NUM_PLAYERS][NUM_RADAR_CATEGORIES]; Sprite m_sprPossibleBar[NUM_PLAYERS][NUM_RadarCategory];
Sprite m_sprActualBar[NUM_PLAYERS][NUM_RADAR_CATEGORIES]; Sprite m_sprActualBar[NUM_PLAYERS][NUM_RadarCategory];
// survived area // survived area
AutoActor m_sprSurvivedFrame[NUM_PLAYERS]; AutoActor m_sprSurvivedFrame[NUM_PLAYERS];
+1 -1
View File
@@ -702,7 +702,7 @@ void ScreenGameplay::Init()
{ {
ASSERT( pi->m_pDifficultyIcon == NULL ); ASSERT( pi->m_pDifficultyIcon == NULL );
pi->m_pDifficultyIcon = new DifficultyIcon; pi->m_pDifficultyIcon = new DifficultyIcon;
pi->m_pDifficultyIcon->Load( THEME->GetPathG(m_sName,ssprintf("difficulty icons %dx%d",NUM_PLAYERS,NUM_DIFFICULTIES)) ); pi->m_pDifficultyIcon->Load( THEME->GetPathG(m_sName,ssprintf("difficulty icons %dx%d",NUM_PLAYERS,NUM_Difficulty)) );
/* Position it in LoadNextSong. */ /* Position it in LoadNextSong. */
this->AddChild( pi->m_pDifficultyIcon ); this->AddChild( pi->m_pDifficultyIcon );
+2 -2
View File
@@ -119,8 +119,8 @@ public:
protected: protected:
ThemeMetric<CString> PLAYER_TYPE; ThemeMetric<CString> PLAYER_TYPE;
ThemeMetric<CString> GIVE_UP_TEXT; LocalizedString GIVE_UP_TEXT;
ThemeMetric<CString> GIVE_UP_ABORTED_TEXT; LocalizedString GIVE_UP_ABORTED_TEXT;
ThemeMetric<float> MUSIC_FADE_OUT_SECONDS; ThemeMetric<float> MUSIC_FADE_OUT_SECONDS;
ThemeMetric<bool> START_GIVES_UP; ThemeMetric<bool> START_GIVES_UP;
ThemeMetric<bool> BACK_GIVES_UP; ThemeMetric<bool> BACK_GIVES_UP;
+2 -1
View File
@@ -14,6 +14,7 @@
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "DifficultyMeter.h" #include "DifficultyMeter.h"
#include "RageSound.h" #include "RageSound.h"
#include "LocalizedString.h"
class HighScoreWheelItem : public ActorFrame class HighScoreWheelItem : public ActorFrame
@@ -70,7 +71,7 @@ private:
ThemeMetric<int> NUM_ALPHABET_DISPLAYED; ThemeMetric<int> NUM_ALPHABET_DISPLAYED;
ThemeMetric<int> MAX_RANKING_NAME_LENGTH; ThemeMetric<int> MAX_RANKING_NAME_LENGTH;
ThemeMetric<float> FEAT_INTERVAL; ThemeMetric<float> FEAT_INTERVAL;
ThemeMetric<CString> KEYBOARD_LETTERS; LocalizedString KEYBOARD_LETTERS;
ActorFrame m_Keyboard[NUM_PLAYERS]; ActorFrame m_Keyboard[NUM_PLAYERS];
Sprite m_sprCursor[NUM_PLAYERS]; Sprite m_sprCursor[NUM_PLAYERS];
+13 -13
View File
@@ -61,7 +61,7 @@ void ScreenNetSelectMusic::Init()
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) ); m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
m_DifficultyIcon[p].Load( THEME->GetPathG( "ScreenSelectMusic", m_DifficultyIcon[p].Load( THEME->GetPathG( "ScreenSelectMusic",
ssprintf("difficulty icons 1x%d", ssprintf("difficulty icons 1x%d",
NUM_DIFFICULTIES)) ); NUM_Difficulty)) );
SET_XY( m_DifficultyIcon[p] ); SET_XY( m_DifficultyIcon[p] );
this->AddChild( &m_DifficultyIcon[p] ); this->AddChild( &m_DifficultyIcon[p] );
ON_COMMAND( m_DifficultyIcon[p] ); ON_COMMAND( m_DifficultyIcon[p] );
@@ -365,20 +365,20 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
vector <Steps *> MultiSteps; vector <Steps *> MultiSteps;
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st ); MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
if (MultiSteps.size() == 0) if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES; m_DC[pn] = NUM_Difficulty;
else else
{ {
int i; int i;
bool dcs[NUM_DIFFICULTIES]; bool dcs[NUM_Difficulty];
for ( i=0; i<NUM_DIFFICULTIES; ++i ) for ( i=0; i<NUM_Difficulty; ++i )
dcs[i] = false; dcs[i] = false;
for ( i=0; i<(int)MultiSteps.size(); ++i ) for ( i=0; i<(int)MultiSteps.size(); ++i )
dcs[MultiSteps[i]->GetDifficulty()] = true; dcs[MultiSteps[i]->GetDifficulty()] = true;
for ( i=0; i<NUM_DIFFICULTIES; ++i ) for ( i=0; i<NUM_Difficulty; ++i )
{ {
if ( (dcs[i]) && (i > m_DC[pn]) ) if ( (dcs[i]) && (i > m_DC[pn]) )
{ {
@@ -387,8 +387,8 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
} }
} }
//If failed to go up, loop //If failed to go up, loop
if ( i == NUM_DIFFICULTIES ) if ( i == NUM_Difficulty )
for (i = 0;i<NUM_DIFFICULTIES;i++) for (i = 0;i<NUM_Difficulty;i++)
if (dcs[i]) if (dcs[i])
{ {
m_DC[pn] = (Difficulty)i; m_DC[pn] = (Difficulty)i;
@@ -499,7 +499,7 @@ void ScreenNetSelectMusic::UpdateDifficulties( PlayerNumber pn )
Steps * pSteps = GAMESTATE->m_pCurSong->GetStepsByDifficulty( st, m_DC[pn] ); Steps * pSteps = GAMESTATE->m_pCurSong->GetStepsByDifficulty( st, m_DC[pn] );
GAMESTATE->m_pCurSteps[pn].Set( pSteps ); GAMESTATE->m_pCurSteps[pn].Set( pSteps );
if ( ( m_DC[pn] < NUM_DIFFICULTIES ) && ( m_DC[pn] >= DIFFICULTY_BEGINNER ) ) if ( ( m_DC[pn] < NUM_Difficulty ) && ( m_DC[pn] >= DIFFICULTY_BEGINNER ) )
m_DifficultyMeters[pn].SetFromSteps( pSteps ); m_DifficultyMeters[pn].SetFromSteps( pSteps );
else else
m_DifficultyMeters[pn].SetFromMeterAndDifficulty( 0, DIFFICULTY_BEGINNER ); m_DifficultyMeters[pn].SetFromMeterAndDifficulty( 0, DIFFICULTY_BEGINNER );
@@ -525,21 +525,21 @@ void ScreenNetSelectMusic::MusicChanged()
vector <Steps *> MultiSteps; vector <Steps *> MultiSteps;
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st ); MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
if (MultiSteps.size() == 0) if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES; m_DC[pn] = NUM_Difficulty;
else else
{ {
int i; int i;
Difficulty Target = DIFFICULTY_EASY; Difficulty Target = DIFFICULTY_EASY;
bool dcs[NUM_DIFFICULTIES]; bool dcs[NUM_Difficulty];
for ( i=0; i<NUM_DIFFICULTIES; ++i ) for ( i=0; i<NUM_Difficulty; ++i )
dcs[i] = false; dcs[i] = false;
for ( i=0; i<(int)MultiSteps.size(); ++i ) for ( i=0; i<(int)MultiSteps.size(); ++i )
dcs[MultiSteps[i]->GetDifficulty()] = true; dcs[MultiSteps[i]->GetDifficulty()] = true;
for ( i=0; i<NUM_DIFFICULTIES; ++i ) for ( i=0; i<NUM_Difficulty; ++i )
if ( dcs[i] ) if ( dcs[i] )
{ {
Target = (Difficulty)i; Target = (Difficulty)i;
@@ -550,7 +550,7 @@ void ScreenNetSelectMusic::MusicChanged()
} }
} }
if ( i == NUM_DIFFICULTIES ) if ( i == NUM_Difficulty )
m_DC[pn] = Target; m_DC[pn] = Target;
} }
UpdateDifficulties( pn ); UpdateDifficulties( pn );
+1 -1
View File
@@ -71,7 +71,7 @@ void ScreenOptionsEditCourse::BeginScreen()
def.m_sName = "Type"; def.m_sName = "Type";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
FOREACH_CourseType( i ) FOREACH_CourseType( i )
def.m_vsChoices.push_back( CourseTypeToThemedString(i) ); def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) );
vDefs.push_back( def ); vDefs.push_back( def );
vHands.push_back( NULL ); vHands.push_back( NULL );
@@ -91,7 +91,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
def.m_vsChoices.clear(); def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" ); def.m_vsChoices.push_back( "(any)" );
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc ) FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), dc )
def.m_vsChoices.push_back( DifficultyToThemedString(*dc) ); def.m_vsChoices.push_back( DifficultyToLocalizedString(*dc) );
vDefs.push_back( def ); vDefs.push_back( def );
vHands.push_back( NULL ); vHands.push_back( NULL );
@@ -114,7 +114,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
def.m_sName = "Sort"; def.m_sName = "Sort";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
FOREACH_SongSort( i ) FOREACH_SongSort( i )
def.m_vsChoices.push_back( SongSortToThemedString(i) ); def.m_vsChoices.push_back( SongSortToLocalizedString(i) );
vDefs.push_back( def ); vDefs.push_back( def );
vHands.push_back( NULL ); vHands.push_back( NULL );
+1 -1
View File
@@ -198,7 +198,7 @@ void ScreenOptionsManageCourses::BeginScreen()
ASSERT(0); ASSERT(0);
case EditMode_Practice: case EditMode_Practice:
case EditMode_Home: case EditMode_Home:
def.m_sName = CourseTypeToThemedString( (*c)->GetCourseType() ); def.m_sName = CourseTypeToLocalizedString( (*c)->GetCourseType() );
break; break;
case EditMode_Full: case EditMode_Full:
if( (*c)->IsAnEdit() ) if( (*c)->IsAnEdit() )
@@ -104,7 +104,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
def.m_bAllowThemeTitle = false; // not themable def.m_bAllowThemeTitle = false; // not themable
def.m_sExplanationName = "Edit Steps"; def.m_sExplanationName = "Edit Steps";
def.m_vsChoices.clear(); def.m_vsChoices.clear();
CString sType = GAMEMAN->StepsTypeToThemedString( (*s)->m_StepsType ); CString sType = GAMEMAN->StepsTypeToLocalizedString( (*s)->m_StepsType );
def.m_vsChoices.push_back( sType ); def.m_vsChoices.push_back( sType );
def.m_bAllowThemeItems = false; // already themed def.m_bAllowThemeItems = false; // already themed
vDefs.push_back( def ); vDefs.push_back( def );
@@ -41,7 +41,7 @@ static const char *ProfileActionNames[] = {
"Clear", "Clear",
}; };
XToString( ProfileAction, NUM_ProfileAction ); XToString( ProfileAction, NUM_ProfileAction );
XToThemedString( ProfileAction, NUM_ProfileAction ); XToLocalizedString( ProfileAction );
#define FOREACH_ProfileAction( i ) FOREACH_ENUM( ProfileAction, NUM_ProfileAction, i ) #define FOREACH_ProfileAction( i ) FOREACH_ENUM( ProfileAction, NUM_ProfileAction, i )
static MenuDef g_TempMenu( static MenuDef g_TempMenu(
@@ -344,7 +344,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus &input
g_TempMenu.rows.clear(); g_TempMenu.rows.clear();
#define ADD_ACTION( i ) \ #define ADD_ACTION( i ) \
g_TempMenu.rows.push_back( MenuRowDef( i, ProfileActionToThemedString(i), true, EditMode_Home, true, 0, "" ) ); g_TempMenu.rows.push_back( MenuRowDef( i, ProfileActionToLocalizedString(i), true, EditMode_Home, true, 0, "" ) );
ADD_ACTION( ProfileAction_SetDefaultP1 ); ADD_ACTION( ProfileAction_SetDefaultP1 );
ADD_ACTION( ProfileAction_SetDefaultP2 ); ADD_ACTION( ProfileAction_SetDefaultP2 );
+2 -2
View File
@@ -196,7 +196,7 @@ float ScreenRanking::SetPage( const PageToShow &pts )
// //
// init page // init page
// //
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.st) ); m_textStepsType.SetText( GameManager::StepsTypeToLocalizedString(pts.st) );
return 0; return 0;
} }
@@ -351,7 +351,7 @@ void ScoreScroller::Load(
ItemTemplate.m_textTitle.LoadFromFont( THEME->GetPathF(sClassName,"list title") ); ItemTemplate.m_textTitle.LoadFromFont( THEME->GetPathF(sClassName,"list title") );
ActorUtil::LoadAllCommands( ItemTemplate.m_textTitle, sClassName ); ActorUtil::LoadAllCommands( ItemTemplate.m_textTitle, sClassName );
ItemTemplate.m_textScore.resize( NUM_DIFFICULTIES ); ItemTemplate.m_textScore.resize( NUM_Difficulty );
FOREACH_CONST( Difficulty, m_DifficultiesToShow, d ) FOREACH_CONST( Difficulty, m_DifficultiesToShow, d )
{ {
ItemTemplate.m_textScore[*d].SetName( "Score" ); ItemTemplate.m_textScore[*d].SetName( "Score" );
+3 -3
View File
@@ -83,7 +83,7 @@ protected:
ThemeMetric<bool> SHOW_ONLY_MOST_RECENT_SCORES; ThemeMetric<bool> SHOW_ONLY_MOST_RECENT_SCORES;
ThemeMetric<float> SECONDS_PER_PAGE; ThemeMetric<float> SECONDS_PER_PAGE;
ThemeMetric<float> PAGE_FADE_SECONDS; ThemeMetric<float> PAGE_FADE_SECONDS;
ThemeMetric<CString> NO_SCORE_NAME; LocalizedString NO_SCORE_NAME;
ThemeMetric<bool> MANUAL_SCROLLING; ThemeMetric<bool> MANUAL_SCROLLING;
}; };
@@ -128,7 +128,7 @@ protected:
ThemeMetric<float> SCORE_OFFSET_START_X; ThemeMetric<float> SCORE_OFFSET_START_X;
ThemeMetric<float> SCORE_OFFSET_Y; ThemeMetric<float> SCORE_OFFSET_Y;
ThemeMetric<bool> SHOW_SURVIVAL_TIME; ThemeMetric<bool> SHOW_SURVIVAL_TIME;
ThemeMetric<CString> NO_SCORE_NAME; LocalizedString NO_SCORE_NAME;
ThemeMetric<float> COL_SPACING_X; ThemeMetric<float> COL_SPACING_X;
ThemeMetric<float> SONG_SCORE_SECONDS_PER_ROW; ThemeMetric<float> SONG_SCORE_SECONDS_PER_ROW;
ThemeMetric<int> m_metricSongScoreRowsToDraw; ThemeMetric<int> m_metricSongScoreRowsToDraw;
@@ -151,7 +151,7 @@ private:
ScoreScroller m_ListScoreRowItems; ScoreScroller m_ListScoreRowItems;
AutoActor m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps AutoActor m_sprDifficulty[NUM_Difficulty]; // for all_steps
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW; ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
ThemeMetric<float> COL_SPACING_X; ThemeMetric<float> COL_SPACING_X;
+1 -1
View File
@@ -223,7 +223,7 @@ void ScreenSelectMusic::Init()
this->AddChild( &m_sprDifficultyFrame[p] ); this->AddChild( &m_sprDifficultyFrame[p] );
m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) ); m_DifficultyIcon[p].SetName( ssprintf("DifficultyIconP%d",p+1) );
m_DifficultyIcon[p].Load( THEME->GetPathG(m_sName,ssprintf("difficulty icons 1x%d",NUM_DIFFICULTIES)) ); m_DifficultyIcon[p].Load( THEME->GetPathG(m_sName,ssprintf("difficulty icons 1x%d",NUM_Difficulty)) );
SET_XY( m_DifficultyIcon[p] ); SET_XY( m_DifficultyIcon[p] );
this->AddChild( &m_DifficultyIcon[p] ); this->AddChild( &m_DifficultyIcon[p] );
+13 -12
View File
@@ -8,6 +8,7 @@
#include "Quad.h" #include "Quad.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "AutoActor.h" #include "AutoActor.h"
#include "LocalizedString.h"
class ScreenSystemLayer : public Screen class ScreenSystemLayer : public Screen
{ {
@@ -28,18 +29,18 @@ private:
CString GetCreditsMessage( PlayerNumber pn ) const; CString GetCreditsMessage( PlayerNumber pn ) const;
ThemeMetric<CString> CREDITS_PRESS_START; LocalizedString CREDITS_PRESS_START;
ThemeMetric<CString> CREDITS_INSERT_CARD; LocalizedString CREDITS_INSERT_CARD;
ThemeMetric<CString> CREDITS_CARD_TOO_LATE; LocalizedString CREDITS_CARD_TOO_LATE;
ThemeMetric<CString> CREDITS_CARD_NO_NAME; LocalizedString CREDITS_CARD_NO_NAME;
ThemeMetric<CString> CREDITS_CARD_READY; LocalizedString CREDITS_CARD_READY;
ThemeMetric<CString> CREDITS_CARD_CHECKING; LocalizedString CREDITS_CARD_CHECKING;
ThemeMetric<CString> CREDITS_CARD_REMOVED; LocalizedString CREDITS_CARD_REMOVED;
ThemeMetric<CString> CREDITS_FREE_PLAY; LocalizedString CREDITS_FREE_PLAY;
ThemeMetric<CString> CREDITS_CREDITS; LocalizedString CREDITS_CREDITS;
ThemeMetric<CString> CREDITS_NOT_PRESENT; LocalizedString CREDITS_NOT_PRESENT;
ThemeMetric<CString> CREDITS_LOAD_FAILED; LocalizedString CREDITS_LOAD_FAILED;
ThemeMetric<CString> CREDITS_LOADED_FROM_LAST_GOOD_APPEND; LocalizedString CREDITS_LOADED_FROM_LAST_GOOD_APPEND;
ThemeMetric<bool> CREDITS_JOIN_ONLY; ThemeMetric<bool> CREDITS_JOIN_ONLY;
}; };
+5 -4
View File
@@ -12,9 +12,10 @@
#include "Foreach.h" #include "Foreach.h"
#include "UnlockManager.h" #include "UnlockManager.h"
#include "ThemeMetric.h" #include "ThemeMetric.h"
#include "LocalizedString.h"
static ThemeMetric<CString> SORT_NOT_AVAILABLE( "Sort", "NotAvailable" ); static LocalizedString SORT_NOT_AVAILABLE( "Sort", "NotAvailable" );
static ThemeMetric<CString> SORT_OTHER ( "Sort", "Other" ); static LocalizedString SORT_OTHER ( "Sort", "Other" );
///////////////////////////////////// /////////////////////////////////////
// Sorting // Sorting
@@ -273,9 +274,9 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
{ {
Grade g = (Grade)i; Grade g = (Grade)i;
if( iCounts[i] > 0 ) if( iCounts[i] > 0 )
return ssprintf( "%4s x %d", GradeToThemedString(g).c_str(), iCounts[i] ); return ssprintf( "%4s x %d", GradeToLocalizedString(g).c_str(), iCounts[i] );
} }
return GradeToThemedString( Grade_NoData ); return GradeToLocalizedString( Grade_NoData );
} }
case SORT_EASY_METER: case SORT_EASY_METER:
{ {
+4 -4
View File
@@ -42,9 +42,9 @@ void StageStats::AssertValid( PlayerNumber pn ) const
CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() ); CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() );
ASSERT( m_player[pn].vpPlayedSteps.size() != 0 ); ASSERT( m_player[pn].vpPlayedSteps.size() != 0 );
ASSERT( m_player[pn].vpPlayedSteps[0] ); ASSERT( m_player[pn].vpPlayedSteps[0] );
ASSERT_M( playMode < NUM_PLAY_MODES, ssprintf("playmode %i", playMode) ); ASSERT_M( playMode < NUM_PlayMode, ssprintf("playmode %i", playMode) );
ASSERT( pStyle != NULL ); ASSERT( pStyle != NULL );
ASSERT_M( m_player[pn].vpPlayedSteps[0]->GetDifficulty() < NUM_DIFFICULTIES, ssprintf("difficulty %i", m_player[pn].vpPlayedSteps[0]->GetDifficulty()) ); ASSERT_M( m_player[pn].vpPlayedSteps[0]->GetDifficulty() < NUM_Difficulty, ssprintf("difficulty %i", m_player[pn].vpPlayedSteps[0]->GetDifficulty()) );
ASSERT( vpPlayedSongs.size() == m_player[pn].vpPlayedSteps.size() ); ASSERT( vpPlayedSongs.size() == m_player[pn].vpPlayedSteps.size() );
ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() ); ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() );
} }
@@ -57,9 +57,9 @@ void StageStats::AssertValid( MultiPlayer pn ) const
CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() ); CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() );
ASSERT( m_multiPlayer[pn].vpPlayedSteps.size() != 0 ); ASSERT( m_multiPlayer[pn].vpPlayedSteps.size() != 0 );
ASSERT( m_multiPlayer[pn].vpPlayedSteps[0] ); ASSERT( m_multiPlayer[pn].vpPlayedSteps[0] );
ASSERT_M( playMode < NUM_PLAY_MODES, ssprintf("playmode %i", playMode) ); ASSERT_M( playMode < NUM_PlayMode, ssprintf("playmode %i", playMode) );
ASSERT( pStyle != NULL ); ASSERT( pStyle != NULL );
ASSERT_M( m_player[pn].vpPlayedSteps[0]->GetDifficulty() < NUM_DIFFICULTIES, ssprintf("difficulty %i", m_player[pn].vpPlayedSteps[0]->GetDifficulty()) ); ASSERT_M( m_player[pn].vpPlayedSteps[0]->GetDifficulty() < NUM_Difficulty, ssprintf("difficulty %i", m_player[pn].vpPlayedSteps[0]->GetDifficulty()) );
ASSERT( vpPlayedSongs.size() == m_player[pn].vpPlayedSteps.size() ); ASSERT( vpPlayedSongs.size() == m_player[pn].vpPlayedSteps.size() );
ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() ); ASSERT( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() );
} }
+8 -4
View File
@@ -59,10 +59,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib # SUBTRACT LINK32 /verbose /profile /pdb:none /incremental:no /nodefaultlib
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Debug6 IntDir=.\../Debug6
TargetDir=\SM Source\stepmania\Program TargetDir=\cvs\stepmania\Program
TargetName=StepMania-debug TargetName=StepMania-debug
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -96,10 +96,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool # Begin Special Build Tool
IntDir=.\../Release6 IntDir=.\../Release6
TargetDir=\SM Source\stepmania\Program TargetDir=\cvs\stepmania\Program
TargetName=StepMania TargetName=StepMania
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=archutils\Win32\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=archutils\Win32\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -1220,6 +1220,10 @@ SOURCE=.\StyleUtil.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\ThemeMetric.h
# End Source File
# Begin Source File
SOURCE=.\TimingData.cpp SOURCE=.\TimingData.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
+3 -3
View File
@@ -104,15 +104,15 @@ float Steps::PredictMeter() const
{ {
float pMeter = 0.775f; float pMeter = 0.775f;
const float RadarCoeffs[NUM_RADAR_CATEGORIES] = const float RadarCoeffs[NUM_RadarCategory] =
{ {
10.1f, 5.27f,-0.905f, -1.10f, 2.86f, 10.1f, 5.27f,-0.905f, -1.10f, 2.86f,
0,0,0,0,0,0 0,0,0,0,0,0
}; };
for( int r = 0; r < NUM_RADAR_CATEGORIES; ++r ) for( int r = 0; r < NUM_RadarCategory; ++r )
pMeter += this->GetRadarValues()[r] * RadarCoeffs[r]; pMeter += this->GetRadarValues()[r] * RadarCoeffs[r];
const float DifficultyCoeffs[NUM_DIFFICULTIES] = const float DifficultyCoeffs[NUM_Difficulty] =
{ {
-0.877f, -0.877f, 0, 0.722f, 0.722f, 0 -0.877f, -0.877f, 0, 0.722f, 0.722f, 0
}; };