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 "AutoActor.h"
#include "ThemeMetric.h"
#include "LocalizedString.h"
class Song;
class Course;
struct DisplayBpms;
@@ -34,8 +35,8 @@ protected:
ThemeMetric<RageColor> CHANGE_COLOR;
ThemeMetric<RageColor> EXTRA_COLOR;
ThemeMetric<bool> CYCLE;
ThemeMetric<CString> SEPARATOR;
ThemeMetric<CString> NO_BPM_TEXT;
LocalizedString SEPARATOR;
LocalizedString NO_BPM_TEXT;
BitmapText m_textBPM;
AutoActor m_sprLabel;
+10 -10
View File
@@ -75,7 +75,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
XNode* p3 = p2->AppendChild( "StepsType" );
p3->AppendAttr( "StepsType", GAMEMAN->StepsTypeToString(*st) );
int iNumStepsInGroupAndStepsType[NUM_DIFFICULTIES];
int iNumStepsInGroupAndStepsType[NUM_Difficulty];
ZERO( iNumStepsInGroupAndStepsType );
FOREACH_CONST( Song*, vpSongsInGroup, i )
{
@@ -250,7 +250,7 @@ void SaveCatalogXml( LoadingWindow *loading_window )
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), 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 )
{
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 )
{
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) )
continue;
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;
sID.FromStyle( (*pStyle) );
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 )
{
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 )
{
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 )
{
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 )
{
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_CPU_MODIFIERS ("Common","DefaultCpuModifiers" );
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<float> CommonMetrics::TICK_EARLY_SECONDS ("ScreenGameplay","TickEarlySeconds");
ThemeMetricDifficultiesToShow CommonMetrics::DIFFICULTIES_TO_SHOW ("Common","DifficultiesToShow");
+2 -1
View File
@@ -7,6 +7,7 @@
#include "PlayerNumber.h"
#include "Difficulty.h"
#include "GameConstantsAndTypes.h"
#include "LocalizedString.h"
//
@@ -54,7 +55,7 @@ namespace CommonMetrics
extern ThemeMetric<CString> DEFAULT_MODIFIERS;
extern ThemeMetric<CString> DEFAULT_CPU_MODIFIERS;
extern ThemeMetric1D<apActorCommands> PLAYER_COLOR;
extern ThemeMetric<CString> WINDOW_TITLE;
extern LocalizedString WINDOW_TITLE;
extern ThemeMetric<int> MAX_COURSE_ENTRIES_BEFORE_VARIOUS;
extern ThemeMetric<float> TICK_EARLY_SECONDS;
extern ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
+6 -5
View File
@@ -22,6 +22,7 @@
#include <limits.h>
#include "CourseLoaderCRS.h"
#include "LuaFunctions.h"
#include "LocalizedString.h"
static const char *CourseTypeNames[] = {
@@ -31,9 +32,9 @@ static const char *CourseTypeNames[] = {
"Survival",
};
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[] = {
@@ -44,7 +45,7 @@ static const char *SongSortNames[] = {
"LowestGrades",
};
XToString( SongSort, NUM_SongSort );
XToThemedString( SongSort, NUM_SongSort );
XToLocalizedString( SongSort );
/* Maximum lower value of ranges when difficult: */
@@ -67,13 +68,13 @@ CString CourseEntry::GetTextDescription() const
if( !sSongGroup.empty() )
vsEntryDescription.push_back( sSongGroup );
if( baseDifficulty != DIFFICULTY_INVALID && baseDifficulty != DIFFICULTY_MEDIUM )
vsEntryDescription.push_back( DifficultyToThemedString(baseDifficulty) );
vsEntryDescription.push_back( DifficultyToLocalizedString(baseDifficulty) );
if( iLowMeter != -1 )
vsEntryDescription.push_back( ssprintf("Low meter: %d", iLowMeter) );
if( iHighMeter != -1 )
vsEntryDescription.push_back( ssprintf("High meter: %d", iHighMeter) );
if( songSort != SongSort_Randomize )
vsEntryDescription.push_back( "Sort: %d" + SongSortToThemedString(songSort) );
vsEntryDescription.push_back( "Sort: %d" + SongSortToLocalizedString(songSort) );
if( songSort != SongSort_Randomize && iChooseIndex != 0 )
vsEntryDescription.push_back( "Choose " + FormatNumberAndSuffix(iChooseIndex) + " match" );
int iNumModChanges = GetNumModChanges();
+3 -3
View File
@@ -31,7 +31,7 @@ enum CourseType
};
#define FOREACH_CourseType( i ) FOREACH_ENUM( CourseType, NUM_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 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 )
const CString& SongSortToString( SongSort ss );
const CString& SongSortToThemedString( SongSort ss );
const CString& SongSortToLocalizedString( SongSort ss );
class CourseEntry
{
@@ -125,7 +125,7 @@ public:
bool m_bRepeat; // repeat after last song? "Endless"
bool m_bShuffle; // play the songs in a random order
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;
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;
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]) );
CString sLine = ssprintf( "#RADAR:%i:%i:", st, cd );
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 );
s.Replace( "Day", "" );
@@ -215,7 +215,7 @@ CString LastDayToThemedString( int iLastDayIndex )
return s;
}
CString LastWeekToThemedString( int iLastWeekIndex )
CString LastWeekToLocalizedString( int iLastWeekIndex )
{
CString s = LastWeekToString( iLastWeekIndex );
s.Replace( "Week", "" );
@@ -223,7 +223,7 @@ CString LastWeekToThemedString( int iLastWeekIndex )
return s;
}
CString HourInDayToThemedString( int iHourIndex )
CString HourInDayToLocalizedString( int iHourIndex )
{
int iBeginHour = iHourIndex;
iBeginHour--;
+4 -4
View File
@@ -12,15 +12,15 @@ enum Month { NUM_Month = 12 };
CString DayInYearToString( int iDayInYearIndex );
CString LastDayToString( int iLastDayIndex );
CString LastDayToThemedString( int iLastDayIndex );
CString LastDayToLocalizedString( int iLastDayIndex );
CString DayOfWeekToString( int iDayOfWeekIndex );
CString DayOfWeekToThemedString( int iDayOfWeekIndex );
CString DayOfWeekToLocalizedString( int iDayOfWeekIndex );
CString HourInDayToString( int iHourIndex );
CString HourInDayToThemedString( int iHourIndex );
CString HourInDayToLocalizedString( int iHourIndex );
const CString &MonthToString( Month month );
const CString &MonthToLocalizedString( Month month );
CString LastWeekToString( int iLastWeekIndex );
CString LastWeekToThemedString( int iLastWeekIndex );
CString LastWeekToLocalizedString( int iLastWeekIndex );
tm AddDays( tm start, int iDaysToMove );
tm GetYesterday( tm start );
+10 -9
View File
@@ -4,6 +4,7 @@
#include "ThemeMetric.h"
#include "LuaManager.h"
#include "LuaFunctions.h"
#include "LocalizedString.h"
static const char *DifficultyNames[] = {
@@ -14,10 +15,10 @@ static const char *DifficultyNames[] = {
"Challenge",
"Edit",
};
XToString( Difficulty, NUM_DIFFICULTIES );
XToThemedString( Difficulty, NUM_DIFFICULTIES );
XToString( Difficulty, NUM_Difficulty );
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
* get normalized when written to SMs, etc.) */
@@ -54,7 +55,7 @@ static void LuaDifficulty(lua_State* L)
s.MakeUpper();
LUA->SetGlobal( "DIFFICULTY_"+s, d );
}
LUA->SetGlobal( "NUM_DIFFICULTIES", NUM_DIFFICULTIES );
LUA->SetGlobal( "NUM_Difficulty", NUM_Difficulty );
}
REGISTER_WITH_LUA_FUNCTION( LuaDifficulty );
@@ -69,15 +70,15 @@ static const char *CourseDifficultyNames[] =
"Challenge",
"Edit",
};
XToString( CourseDifficulty, NUM_DIFFICULTIES );
XToThemedString( CourseDifficulty, NUM_DIFFICULTIES );
XToString( CourseDifficulty, NUM_Difficulty );
XToLocalizedString( CourseDifficulty );
StringToX( CourseDifficulty );
LuaFunction( CourseDifficultyToThemedString, CourseDifficultyToThemedString((CourseDifficulty)IArg(1)) );
LuaFunction( CourseDifficultyToLocalizedString, CourseDifficultyToLocalizedString((CourseDifficulty)IArg(1)) );
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) )
return d;
@@ -93,7 +94,7 @@ static void LuaCourseDifficulty(lua_State* L)
s.MakeUpper();
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 );
+5 -5
View File
@@ -14,22 +14,22 @@ enum Difficulty
DIFFICULTY_HARD,
DIFFICULTY_CHALLENGE,
DIFFICULTY_EDIT,
NUM_DIFFICULTIES,
NUM_Difficulty,
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& DifficultyToThemedString( Difficulty dc );
const CString& DifficultyToLocalizedString( Difficulty dc );
Difficulty StringToDifficulty( const CString& sDC );
typedef Difficulty CourseDifficulty;
#define NUM_COURSE_DIFFICULTIES NUM_DIFFICULTIES
#define NUM_CourseDifficulty NUM_Difficulty
#define FOREACH_CourseDifficulty FOREACH_Difficulty
#define FOREACH_ShownCourseDifficulty( cd ) for( Difficulty cd=GetNextShownCourseDifficulty((CourseDifficulty)-1); cd!=DIFFICULTY_INVALID; cd=GetNextShownCourseDifficulty(cd) )
const CString& CourseDifficultyToString( Difficulty dc );
const CString& CourseDifficultyToThemedString( Difficulty dc );
const CString& CourseDifficultyToLocalizedString( Difficulty dc );
Difficulty StringToCourseDifficulty( const CString& sDC );
Difficulty GetNextShownCourseDifficulty( Difficulty pn );
+1 -1
View File
@@ -14,7 +14,7 @@ DifficultyDisplay::DifficultyDisplay()
int 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].StopAnimating();
this->AddChild( &m_difficulty[diff] );
+1 -1
View File
@@ -16,7 +16,7 @@ public:
void UnsetDifficulties();
protected:
Sprite m_difficulty[NUM_DIFFICULTIES];
Sprite m_difficulty[NUM_Difficulty];
};
#endif
+5 -5
View File
@@ -22,7 +22,7 @@ bool DifficultyIcon::Load( CString sPath )
{
Sprite::Load( sPath );
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 )
bWarn = false;
if( bWarn )
@@ -30,8 +30,8 @@ bool DifficultyIcon::Load( CString sPath )
CString sError = ssprintf(
"The difficulty icon graphic '%s' must have %d or %d frames. It has %d states.",
sPath.c_str(),
NUM_DIFFICULTIES,
NUM_DIFFICULTIES*2,
NUM_Difficulty,
NUM_Difficulty*2,
iStates );
Dialog::OK( sError );
}
@@ -75,8 +75,8 @@ void DifficultyIcon::SetFromDifficulty( PlayerNumber pn, Difficulty dc )
m_bBlank = false;
switch( GetNumStates() )
{
case NUM_DIFFICULTIES: SetState( dc ); break;
case NUM_DIFFICULTIES*2: SetState( dc*2+pn ); break;
case NUM_Difficulty: SetState( dc ); break;
case NUM_Difficulty*2: SetState( dc*2+pn ); break;
default: m_bBlank = true; break;
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
#include "Command.h"
#include "Foreach.h"
#define MAX_METERS NUM_DIFFICULTIES + MAX_EDITS_PER_SONG
#define MAX_METERS NUM_Difficulty + MAX_EDITS_PER_SONG
DifficultyList::DifficultyList()
{
+1 -1
View File
@@ -64,7 +64,7 @@ void DifficultyMeter::Load( const CString &sType )
CString Feet;
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 += 'X'; // Off
}
+14 -14
View File
@@ -24,8 +24,8 @@ static const char *EditMenuRowNames[] = {
"SourceSteps",
"Action"
};
XToString( EditMenuRow, NUM_EDIT_MENU_ROWS );
XToThemedString( EditMenuRow, NUM_EDIT_MENU_ROWS );
XToString( EditMenuRow, NUM_EditMenuRow );
XToLocalizedString( EditMenuRow );
static const char *EditMenuActionNames[] = {
"Edit",
@@ -34,7 +34,7 @@ static const char *EditMenuActionNames[] = {
"Practice",
};
XToString( EditMenuAction, NUM_EditMenuAction );
XToThemedString( EditMenuAction, NUM_EditMenuAction );
XToLocalizedString( EditMenuAction );
StringToX( EditMenuAction );
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");
ROW_LABELS_X.Load(sType,"RowLabelsX");
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_Y.Load(sType,ROW_Y_NAME,NUM_EDIT_MENU_ROWS);
ROW_Y.Load(sType,ROW_Y_NAME,NUM_EditMenuRow);
EDIT_MODE.Load(sType,"EditMode");
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].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].SetHorizAlign( Actor::align_left );
this->AddChild( &m_textLabel[r] );
@@ -238,7 +238,7 @@ bool EditMenu::CanGoUp()
bool EditMenu::CanGoDown()
{
return m_SelectedRow != NUM_EDIT_MENU_ROWS-1;
return m_SelectedRow != NUM_EditMenuRow-1;
}
bool EditMenu::CanGoLeft()
@@ -359,7 +359,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
m_SongTextBanner.LoadFromSong( GetSelectedSong() );
// fall through
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();
@@ -437,11 +437,11 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
s += "-no name-";
else
s += pSteps->GetDescription();
s += " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")";
s += " (" + DifficultyToLocalizedString(DIFFICULTY_EDIT) + ")";
}
else
{
s = DifficultyToThemedString(GetSelectedDifficulty());
s = DifficultyToLocalizedString(GetSelectedDifficulty());
// UGLY. "Edit" -> "New Edit"
switch( EDIT_MODE.GetValue() )
@@ -466,7 +466,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
case ROW_SOURCE_STEPS_TYPE:
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].SetText( GAMEMAN->StepsTypeToThemedString(GetSelectedSourceStepsType()) );
m_textValue[ROW_SOURCE_STEPS_TYPE].SetText( GAMEMAN->StepsTypeToLocalizedString(GetSelectedSourceStepsType()) );
m_vpSourceSteps.clear();
m_vpSourceSteps.push_back( StepsAndDifficulty(NULL,DIFFICULTY_INVALID) ); // "blank"
@@ -501,9 +501,9 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
if( GetSelectedSourceDifficulty() == DIFFICULTY_INVALID )
s = "Blank";
else if( pSourceSteps && GetSelectedSourceDifficulty() == DIFFICULTY_EDIT )
s = pSourceSteps->GetDescription() + " (" + DifficultyToThemedString(DIFFICULTY_EDIT) + ")";
s = pSourceSteps->GetDescription() + " (" + DifficultyToLocalizedString(DIFFICULTY_EDIT) + ")";
else
s = DifficultyToThemedString(GetSelectedSourceDifficulty());
s = DifficultyToLocalizedString(GetSelectedSourceDifficulty());
m_textValue[ROW_SOURCE_STEPS].SetText( s );
}
bool bHideMeter = false;
@@ -540,7 +540,7 @@ void EditMenu::OnRowValueChanged( EditMenuRow row )
}
// fall through
case ROW_ACTION:
m_textValue[ROW_ACTION].SetText( EditMenuActionToThemedString(GetSelectedAction()) );
m_textValue[ROW_ACTION].SetText( EditMenuActionToLocalizedString(GetSelectedAction()) );
break;
default:
ASSERT(0); // invalid row
+7 -7
View File
@@ -23,11 +23,11 @@ enum EditMenuRow
ROW_SOURCE_STEPS_TYPE,
ROW_SOURCE_STEPS,
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& EditMenuRowToThemedString( EditMenuRow r );
const CString& EditMenuRowToLocalizedString( EditMenuRow r );
enum EditMenuAction
{
@@ -39,7 +39,7 @@ enum EditMenuAction
};
#define FOREACH_EditMenuAction( ema ) FOREACH_ENUM( EditMenuAction, NUM_EditMenuAction, ema )
const CString& EditMenuActionToString( EditMenuAction ema );
const CString& EditMenuActionToThemedString( EditMenuAction ema );
const CString& EditMenuActionToLocalizedString( EditMenuAction ema );
const int NUM_ARROWS = 2;
@@ -84,9 +84,9 @@ private:
EditMenuRow m_SelectedRow;
EditMenuRow GetFirstRow() const { return SHOW_GROUPS.GetValue()? ROW_GROUP:ROW_SONG; }
int GetRowSize( EditMenuRow er ) const;
int m_iSelection[NUM_EDIT_MENU_ROWS];
BitmapText m_textLabel[NUM_EDIT_MENU_ROWS];
BitmapText m_textValue[NUM_EDIT_MENU_ROWS];
int m_iSelection[NUM_EditMenuRow];
BitmapText m_textLabel[NUM_EditMenuRow];
BitmapText m_textValue[NUM_EditMenuRow];
FadingBanner m_GroupBanner;
FadingBanner m_SongBanner;
-13
View File
@@ -68,19 +68,6 @@ static const CString EMPTY_STRING;
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) \
const CString &X##ToLocalizedString( X x ) \
{ \
+17 -16
View File
@@ -10,6 +10,7 @@
#include <float.h>
#include "LuaFunctions.h"
#include "LocalizedString.h"
const CString RANKING_TO_FILL_IN_MARKER[NUM_PLAYERS] = {"#P1#","#P2#"};
@@ -28,9 +29,9 @@ static const char *RadarCategoryNames[] = {
"Hands",
"Rolls"
};
XToString( RadarCategory, NUM_RADAR_CATEGORIES );
XToThemedString( RadarCategory, NUM_RADAR_CATEGORIES );
LuaFunction( RadarCategoryToThemedString, RadarCategoryToThemedString((RadarCategory) IArg(1)) );
XToString( RadarCategory, NUM_RadarCategory );
XToLocalizedString( RadarCategory );
LuaFunction( RadarCategoryToLocalizedString, RadarCategoryToLocalizedString((RadarCategory) IArg(1)) );
static void LuaRadarCategory(lua_State* L)
{
@@ -64,12 +65,12 @@ static const char *PlayModeNames[] = {
"Battle",
"Rave",
};
XToString( PlayMode, NUM_PLAY_MODES );
XToThemedString( PlayMode, NUM_PLAY_MODES );
XToString( PlayMode, NUM_PlayMode );
XToLocalizedString( PlayMode );
StringToX( PlayMode );
LuaXToString( PlayMode );
LuaFunction( PlayModeToThemedString, PlayModeToThemedString((PlayMode) IArg(1)) );
LuaXType( PlayMode, NUM_PLAY_MODES, "PLAY_MODE_", true )
LuaFunction( PlayModeToLocalizedString, PlayModeToLocalizedString((PlayMode) IArg(1)) );
LuaXType( PlayMode, NUM_PlayMode, "PLAY_MODE_", true )
RankingCategory AverageMeterToRankingCategory( int iAverageMeter )
{
@@ -214,8 +215,8 @@ TapNoteScore StringToTapNoteScore( const CString &s )
return TNS_INVALID;
}
XToThemedString( TapNoteScore, NUM_TapNoteScore );
LuaFunction( TapNoteScoreToThemedString, TapNoteScoreToThemedString((TapNoteScore) IArg(1)) );
XToLocalizedString( TapNoteScore );
LuaFunction( TapNoteScoreToLocalizedString, TapNoteScoreToLocalizedString((TapNoteScore) IArg(1)) );
static void LuaTapNoteScores( lua_State* L )
{
FOREACH_TapNoteScore( i )
@@ -246,7 +247,7 @@ HoldNoteScore StringToHoldNoteScore( const CString &s )
return HNS_INVALID;
}
XToThemedString( HoldNoteScore, NUM_HoldNoteScore );
XToLocalizedString( HoldNoteScore );
static void LuaHoldNoteScores( lua_State* L )
{
FOREACH_HoldNoteScore( i )
@@ -281,10 +282,10 @@ static const char *PerDifficultyAwardNames[] = {
"Percent90W3",
"Percent100W3",
};
XToString( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS );
XToThemedString( PerDifficultyAward, NUM_PER_DIFFICULTY_AWARDS );
XToString( PerDifficultyAward, NUM_PerDifficultyAward );
XToLocalizedString( PerDifficultyAward );
StringToX( PerDifficultyAward );
LuaFunction( PerDifficultyAwardToThemedString, PerDifficultyAwardToThemedString((PerDifficultyAward) IArg(1)) );
LuaFunction( PerDifficultyAwardToLocalizedString, PerDifficultyAwardToLocalizedString((PerDifficultyAward) IArg(1)) );
static void LuaPerDifficultyAward( lua_State* L )
{
FOREACH_PerDifficultyAward( i )
@@ -308,10 +309,10 @@ static const char *PeakComboAwardNames[] = {
"Peak9000Combo",
"Peak10000Combo",
};
XToString( PeakComboAward, NUM_PEAK_COMBO_AWARDS );
XToThemedString( PeakComboAward, NUM_PEAK_COMBO_AWARDS );
XToString( PeakComboAward, NUM_PeakComboAward );
XToLocalizedString( PeakComboAward );
StringToX( PeakComboAward );
LuaFunction( PeakComboAwardToThemedString, PeakComboAwardToThemedString((PeakComboAward) IArg(1)) );
LuaFunction( PeakComboAwardToLocalizedString, PeakComboAwardToLocalizedString((PeakComboAward) IArg(1)) );
static void LuaPeakComboAward( lua_State* L )
{
FOREACH_PeakComboAward( i )
+14 -14
View File
@@ -29,11 +29,11 @@ enum RadarCategory
RadarCategory_Mines,
RadarCategory_Hands,
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& RadarCategoryToThemedString( RadarCategory cat );
const CString& RadarCategoryToLocalizedString( RadarCategory cat );
enum StepsType
@@ -82,12 +82,12 @@ enum PlayMode
PLAY_MODE_ENDLESS,
PLAY_MODE_BATTLE, // manually launched attacks
PLAY_MODE_RAVE, // automatically launched attacks
NUM_PLAY_MODES,
NUM_PlayMode,
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& PlayModeToThemedString( PlayMode pm );
const CString& PlayModeToLocalizedString( PlayMode pm );
PlayMode StringToPlayMode( const CString& s );
@@ -142,7 +142,7 @@ enum TapNoteScore {
};
#define FOREACH_TapNoteScore( tns ) FOREACH_ENUM( TapNoteScore, NUM_TapNoteScore, tns )
const CString& TapNoteScoreToString( TapNoteScore tns );
const CString& TapNoteScoreToThemedString( TapNoteScore tns );
const CString& TapNoteScoreToLocalizedString( TapNoteScore tns );
TapNoteScore StringToTapNoteScore( const CString& str );
@@ -156,7 +156,7 @@ enum HoldNoteScore
};
#define FOREACH_HoldNoteScore( hns ) FOREACH_ENUM( HoldNoteScore, NUM_HoldNoteScore, hns )
const CString& HoldNoteScoreToString( HoldNoteScore hns );
const CString& HoldNoteScoreToThemedString( HoldNoteScore hns );
const CString& HoldNoteScoreToLocalizedString( HoldNoteScore hns );
HoldNoteScore StringToHoldNoteScore( const CString& str );
@@ -333,12 +333,12 @@ enum PerDifficultyAward
AWARD_PERCENT_80_W3,
AWARD_PERCENT_90_W3,
AWARD_PERCENT_100_W3,
NUM_PER_DIFFICULTY_AWARDS,
NUM_PerDifficultyAward,
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& PerDifficultyAwardToThemedString( PerDifficultyAward pma );
const CString& PerDifficultyAwardToLocalizedString( PerDifficultyAward pma );
PerDifficultyAward StringToPerDifficultyAward( const CString& pma );
@@ -354,12 +354,12 @@ enum PeakComboAward
AWARD_8000_PEAK_COMBO,
AWARD_9000_PEAK_COMBO,
AWARD_10000_PEAK_COMBO,
NUM_PEAK_COMBO_AWARDS,
NUM_PeakComboAward,
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& PeakComboAwardToThemedString( PeakComboAward pma );
const CString& PeakComboAwardToLocalizedString( PeakComboAward pma );
PeakComboAward StringToPeakComboAward( const CString& pma );
+4 -4
View File
@@ -2750,7 +2750,7 @@ CString GameManager::StepsTypeToString( StepsType st )
return StepsTypes[st].name;
}
CString GameManager::StepsTypeToThemedString( StepsType st )
CString GameManager::StepsTypeToLocalizedString( StepsType st )
{
CString s = StepsTypeToString( st );
if( THEME->HasMetric( "StepsType", s ) )
@@ -2759,7 +2759,7 @@ CString GameManager::StepsTypeToThemedString( StepsType st )
return s;
}
CString GameManager::StyleToThemedString( const Style* style )
CString GameManager::StyleToLocalizedString( const Style* style )
{
CString s = style->m_szName;
s = Capitalize( s );
@@ -2854,7 +2854,7 @@ class LunaGameManager: public Luna<GameManager>
public:
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 )
{
vector<StepsType> vstAddTo;
@@ -2867,7 +2867,7 @@ public:
static void Register(lua_State *L)
{
ADD_METHOD( StepsTypeToThemedString );
ADD_METHOD( StepsTypeToLocalizedString );
ADD_METHOD( GetFirstStepsTypeForCurrentGame );
Luna<T>::Register( L );
+2 -2
View File
@@ -31,10 +31,10 @@ public:
static int StepsTypeToNumTracks( StepsType st );
static StepsType StringToStepsType( CString sStepsType );
static CString StepsTypeToString( StepsType st );
static CString StepsTypeToThemedString( StepsType st );
static CString StepsTypeToLocalizedString( StepsType st );
static const Game* StringToGameType( CString sGameType );
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;
// Lua
+4 -4
View File
@@ -1519,7 +1519,7 @@ void GameState::GetRankingFeats( PlayerNumber pn, vector<RankingFeat> &asFeatsOu
feat.pCourse = pCourse;
feat.Feat = ssprintf("MR #%d in %s", i+1, pCourse->GetDisplayFullTitle().c_str() );
if( cd != DIFFICULTY_MEDIUM )
feat.Feat += " " + CourseDifficultyToThemedString(cd);
feat.Feat += " " + CourseDifficultyToLocalizedString(cd);
feat.pStringToFill = hs.GetNameMutable();
feat.grade = Grade_NoData;
feat.iScore = hs.GetScore();
@@ -1735,7 +1735,7 @@ bool GameState::ChangePreferredDifficulty( PlayerNumber pn, int dir )
while( 1 )
{
d = (Difficulty)(d+dir);
if( d < 0 || d >= NUM_DIFFICULTIES )
if( d < 0 || d >= NUM_Difficulty )
return false;
if( find(v.begin(), v.end(), d) != v.end() )
break; // found
@@ -1767,7 +1767,7 @@ bool GameState::ChangePreferredCourseDifficulty( PlayerNumber pn, int dir )
while( 1 )
{
cd = (CourseDifficulty)(cd+dir);
if( cd < 0 || cd >= NUM_DIFFICULTIES )
if( cd < 0 || cd >= NUM_Difficulty )
return false;
if( find(v.begin(),v.end(),cd) == v.end() )
continue; /* not available */
@@ -2103,7 +2103,7 @@ public:
for( unsigned i=0; i<vpStepsToShow.size(); i++ )
{
const Steps* pSteps = vpStepsToShow[i];
CString sDifficulty = DifficultyToThemedString( pSteps->GetDifficulty() );
CString sDifficulty = DifficultyToLocalizedString( pSteps->GetDifficulty() );
// HACK: reset capitalization
sDifficulty.MakeLower();
+1 -1
View File
@@ -9,7 +9,7 @@
LuaFunction( GradeToString, GradeToString((Grade)IArg(1)) )
CString GradeToThemedString( Grade g )
CString GradeToLocalizedString( Grade g )
{
CString s = GradeToString(g);
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 GradeToThemedString( Grade g );
CString GradeToLocalizedString( Grade g );
Grade StringToGrade( const CString &s );
#define FOREACH_Grade( g ) FOREACH_ENUM( Grade, NUM_Grade, 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;
float m_PercentTowardNew;
float m_fValuesNew[NUM_RADAR_CATEGORIES];
float m_fValuesOld[NUM_RADAR_CATEGORIES];
float m_fValuesNew[NUM_RadarCategory];
float m_fValuesOld[NUM_RadarCategory];
PlayerNumber m_PlayerNumber;
};
Sprite m_sprRadarBase;
GrooveRadarValueMap m_GrooveRadarValueMap[NUM_PLAYERS];
Sprite m_sprRadarLabels[NUM_RADAR_CATEGORIES];
Sprite m_sprRadarLabels[NUM_RadarCategory];
ActorFrame m_Frame;
};
+18 -5
View File
@@ -29,14 +29,15 @@ RString LocalizedString::LocalizeString( const RString &sSection, const RString
return g_pfnLocalizer( sSection, sName );
}
LocalizedString::LocalizedString()
{
g_Subscribers.Subscribe( this );
}
LocalizedString::LocalizedString( const RString &sSection, const RString &sName )
{
m_sSection = sSection;
m_sName = sName;
m_sValue = sName;
Load( sSection, sName );
g_Subscribers.Subscribe( this );
Refresh();
}
@@ -46,6 +47,12 @@ LocalizedString::~LocalizedString()
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
{
@@ -54,6 +61,7 @@ LocalizedString::operator RString() const
const RString &LocalizedString::GetValue() const
{
ASSERT( IsLoaded() );
return m_sValue;
}
@@ -62,6 +70,11 @@ void LocalizedString::Refresh()
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) ) )
/*
+3
View File
@@ -11,11 +11,14 @@ public:
static RString LocalizeString( const RString &sSection, const RString &sName );
LocalizedString();
LocalizedString( const RString &sSection, const RString &sName );
~LocalizedString();
void Load( const RString &sSection, const RString &sName );
void Refresh();
operator RString() const;
const RString &GetValue() const;
bool IsLoaded() const;
private:
RString m_sSection;
RString m_sName;
+1 -1
View File
@@ -49,7 +49,7 @@ void SMLoader::LoadFromSMTokens(
out.SetMeter(atoi(sMeter));
vector<CString> saValues;
split( sRadarValues, ",", saValues, true );
if( saValues.size() == NUM_RADAR_CATEGORIES )
if( saValues.size() == NUM_RadarCategory )
{
RadarValues v;
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( " %d:", in.GetMeter() ) );
int MaxRadar = bSavingCache? NUM_RADAR_CATEGORIES:5;
int MaxRadar = bSavingCache? NUM_RadarCategory:5;
vector<CString> asRadarValues;
for( int r=0; r < MaxRadar; r++ )
asRadarValues.push_back( ssprintf("%.3f", in.GetRadarValues()[r]) );
+6 -6
View File
@@ -317,7 +317,7 @@ public:
{
Trail* pTrail = vTrails[i];
CString s = CourseDifficultyToThemedString( pTrail->m_CourseDifficulty );
CString s = CourseDifficultyToLocalizedString( pTrail->m_CourseDifficulty );
s += ssprintf( " %d", pTrail->GetMeter() );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
@@ -340,7 +340,7 @@ public:
if( pSteps->GetDifficulty() == DIFFICULTY_EDIT )
s = pSteps->GetDescription();
else
s = DifficultyToThemedString( pSteps->GetDifficulty() );
s = DifficultyToLocalizedString( pSteps->GetDifficulty() );
s += ssprintf( " %d", pSteps->GetMeter() );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
@@ -401,7 +401,7 @@ public:
ASSERT( vStyles.size() );
FOREACH_CONST( const Style*, vStyles, s )
{
defOut.m_vsChoices.push_back( GAMEMAN->StyleToThemedString(*s) );
defOut.m_vsChoices.push_back( GAMEMAN->StyleToLocalizedString(*s) );
GameCommand mc;
mc.m_pStyle = *s;
ListEntries.push_back( mc );
@@ -463,7 +463,7 @@ public:
FOREACH_CONST( Difficulty, CommonMetrics::DIFFICULTIES_TO_SHOW.GetValue(), d )
{
CString s = DifficultyToThemedString( *d );
CString s = DifficultyToLocalizedString( *d );
defOut.m_vsChoices.push_back( s );
GameCommand mc;
@@ -950,7 +950,7 @@ public:
FOREACH_CONST( StepsType, m_vStepsTypesToShow, st )
{
CString s = GAMEMAN->StepsTypeToThemedString( *st );
CString s = GAMEMAN->StepsTypeToLocalizedString( *st );
defOut.m_vsChoices.push_back( s );
}
@@ -1085,7 +1085,7 @@ public:
}
else
{
s = DifficultyToThemedString( dc );
s = DifficultyToLocalizedString( dc );
}
defOut.m_vsChoices.push_back( s );
}
+3 -2
View File
@@ -11,6 +11,7 @@
#include "GameConstantsAndTypes.h"
#include "ThemeMetric.h"
class XNode;
#include "LocalizedString.h"
enum PaneTypes
{
@@ -75,8 +76,8 @@ private:
PaneTypes m_CurPane;
PlayerNumber m_PlayerNumber;
ThemeMetric<CString> EMPTY_MACHINE_HIGH_SCORE_NAME;
ThemeMetric<CString> NOT_AVAILABLE;
LocalizedString EMPTY_MACHINE_HIGH_SCORE_NAME;
LocalizedString NOT_AVAILABLE;
};
#endif
+3 -3
View File
@@ -2,14 +2,14 @@
#include "PlayerNumber.h"
#include "GameState.h"
#include "LuaManager.h"
#include "ThemeMetric.h"
#include "LocalizedString.h"
static const char *PlayerNumberNames[] = {
"P1",
"P2",
};
XToString( PlayerNumber, NUM_PLAYERS );
XToThemedString( PlayerNumber, NUM_PLAYERS );
XToLocalizedString( PlayerNumber );
void LuaPlayerNumber(lua_State* L)
{
@@ -31,7 +31,7 @@ static const char *MultiPlayerNames[] = {
"P8",
};
XToString( MultiPlayer, NUM_MultiPlayer );
XToThemedString( MultiPlayer, NUM_MultiPlayer );
XToLocalizedString( MultiPlayer );
PlayerNumber GetNextHumanPlayer( PlayerNumber pn )
+4 -3
View File
@@ -13,11 +13,12 @@ enum PlayerNumber
{
PLAYER_1 = 0,
PLAYER_2,
NUM_PLAYERS, // leave this at the end
NUM_PlayerNumber, // leave this at the end
PLAYER_INVALID
};
const int NUM_PLAYERS = NUM_PlayerNumber;
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_HumanPlayer( pn ) for( PlayerNumber pn=GetNextHumanPlayer((PlayerNumber)-1); pn!=PLAYER_INVALID; pn=GetNextHumanPlayer(pn) )
@@ -47,7 +48,7 @@ enum MultiPlayer
MultiPlayer_INVALID
};
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 )
+3 -3
View File
@@ -137,13 +137,13 @@ public:
mutable DateTime m_LastPlayedDate;
/* 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. */
int m_iNumSongsPlayedByPlayMode[NUM_PLAY_MODES];
int m_iNumSongsPlayedByPlayMode[NUM_PlayMode];
map<StyleID,int> m_iNumSongsPlayedByStyle;
int m_iNumSongsPlayedByDifficulty[NUM_DIFFICULTIES];
int m_iNumSongsPlayedByDifficulty[NUM_Difficulty];
int m_iNumSongsPlayedByMeter[MAX_METER+1];
/* This stat counts once per song, even if two players are active. */
int m_iNumTotalSongsPlayed;
int m_iNumStagesPassedByPlayMode[NUM_PLAY_MODES];
int m_iNumStagesPassedByPlayMode[NUM_PlayMode];
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
{
if( iMaxValues == -1 )
iMaxValues = NUM_RADAR_CATEGORIES;
iMaxValues = min( iMaxValues, (int)NUM_RADAR_CATEGORIES );
iMaxValues = NUM_RadarCategory;
iMaxValues = min( iMaxValues, (int)NUM_RadarCategory );
vector<CString> asRadarValues;
for( int r=0; r < iMaxValues; r++ )
@@ -78,7 +78,7 @@ void RadarValues::FromString( CString sRadarValues )
vector<CString> saValues;
split( sRadarValues, ",", saValues, true );
if( saValues.size() != NUM_RADAR_CATEGORIES )
if( saValues.size() != NUM_RadarCategory )
{
MakeUnknown();
return;
+1 -1
View File
@@ -27,7 +27,7 @@ struct RadarValues
float fNumHands;
float fNumRolls;
} v;
float f[NUM_RADAR_CATEGORIES];
float f[NUM_RadarCategory];
} m_Values;
operator const float* () const { return m_Values.f; };
+4 -4
View File
@@ -134,7 +134,7 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle, sData;
for( int i=0; i<NUM_LAST_DAYS; i++ )
{
sTitle += LastDayToThemedString(i) + "\n";
sTitle += LastDayToLocalizedString(i) + "\n";
sData += ssprintf("%d",coins[i]) + "\n";
iTotalLast += coins[i];
}
@@ -164,7 +164,7 @@ void ScreenBookkeeping::ChangeView( View newView )
for( int row=0; row<52/4; row++ )
{
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 );
@@ -204,14 +204,14 @@ void ScreenBookkeeping::ChangeView( View newView )
CString sTitle1, sData1;
for( int i=0; i<HOURS_IN_DAY/2; i++ )
{
sTitle1 += HourInDayToThemedString(i) + "\n";
sTitle1 += HourInDayToLocalizedString(i) + "\n";
sData1 += ssprintf("%d",coins[i]) + "\n";
}
CString sTitle2, sData2;
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";
}
+1 -1
View File
@@ -2542,7 +2542,7 @@ void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAns
g_StepsInformation.rows[difficulty].choices.clear();
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].bEnabled = (EDIT_MODE.GetValue() >= EditMode_Full);
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 )
s = pSourceSteps->GetDescription();
else
s = DifficultyToThemedString( pSourceSteps->GetDifficulty() );
s = DifficultyToLocalizedString( pSourceSteps->GetDifficulty() );
return s;
}
+10 -10
View File
@@ -30,7 +30,7 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line )
case PERCENT_COMPLETE:
{
StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st);
CString sType = GAMESTATE->IsCourseMode() ? "Courses" : "Songs";
return ssprintf( "%s %s %%", sStepsType.c_str(), sType.c_str() );
}
@@ -42,16 +42,16 @@ CString GetStatsLineTitle( PlayerNumber pn, EndingStatsLine line )
if( GAMESTATE->IsCourseMode() )
{
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) )
return CString();
return CourseDifficultyToThemedString(cd);
return CourseDifficultyToLocalizedString(cd);
}
else
{
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
return DifficultyToThemedString(dc);
ASSERT( dc >= 0 && dc < NUM_Difficulty );
return DifficultyToLocalizedString(dc);
}
}
default: ASSERT(0); return CString();
@@ -101,22 +101,22 @@ CString GetStatsLineValue( PlayerNumber pn, EndingStatsLine line )
case PERCENT_COMPLETE_CHALLENGE:
// Ugly...
{
CString sStepsType = GAMEMAN->StepsTypeToThemedString(st);
CString sStepsType = GAMEMAN->StepsTypeToLocalizedString(st);
float fPercent = 0;
if( GAMESTATE->IsCourseMode() )
{
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) )
return CString();
CString sDifficulty = CourseDifficultyToThemedString(cd);
CString sDifficulty = CourseDifficultyToLocalizedString(cd);
fPercent = pProfile->GetCoursesPercentComplete(st,cd);
}
else
{
Difficulty dc = (Difficulty)(DIFFICULTY_EASY+line-PERCENT_COMPLETE_EASY);
ASSERT( dc >= 0 && dc < NUM_DIFFICULTIES );
CString sDifficulty = DifficultyToThemedString(dc);
ASSERT( dc >= 0 && dc < NUM_Difficulty );
CString sDifficulty = DifficultyToLocalizedString(dc);
fPercent = pProfile->GetSongsPercentComplete(st,dc);
}
return ssprintf( "%05.2f%%", fPercent*100 );
+1 -1
View File
@@ -206,7 +206,7 @@ void ScreenEvaluation::Init()
//
{
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.radarActual[p][r] = 0.5f + r/10.0f;
+2 -2
View File
@@ -76,8 +76,8 @@ protected:
// bonus area
AutoActor m_sprBonusFrame[NUM_PLAYERS];
Sprite m_sprPossibleBar[NUM_PLAYERS][NUM_RADAR_CATEGORIES];
Sprite m_sprActualBar[NUM_PLAYERS][NUM_RADAR_CATEGORIES];
Sprite m_sprPossibleBar[NUM_PLAYERS][NUM_RadarCategory];
Sprite m_sprActualBar[NUM_PLAYERS][NUM_RadarCategory];
// survived area
AutoActor m_sprSurvivedFrame[NUM_PLAYERS];
+1 -1
View File
@@ -702,7 +702,7 @@ void ScreenGameplay::Init()
{
ASSERT( pi->m_pDifficultyIcon == NULL );
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. */
this->AddChild( pi->m_pDifficultyIcon );
+2 -2
View File
@@ -119,8 +119,8 @@ public:
protected:
ThemeMetric<CString> PLAYER_TYPE;
ThemeMetric<CString> GIVE_UP_TEXT;
ThemeMetric<CString> GIVE_UP_ABORTED_TEXT;
LocalizedString GIVE_UP_TEXT;
LocalizedString GIVE_UP_ABORTED_TEXT;
ThemeMetric<float> MUSIC_FADE_OUT_SECONDS;
ThemeMetric<bool> START_GIVES_UP;
ThemeMetric<bool> BACK_GIVES_UP;
+2 -1
View File
@@ -14,6 +14,7 @@
#include "ThemeMetric.h"
#include "DifficultyMeter.h"
#include "RageSound.h"
#include "LocalizedString.h"
class HighScoreWheelItem : public ActorFrame
@@ -70,7 +71,7 @@ private:
ThemeMetric<int> NUM_ALPHABET_DISPLAYED;
ThemeMetric<int> MAX_RANKING_NAME_LENGTH;
ThemeMetric<float> FEAT_INTERVAL;
ThemeMetric<CString> KEYBOARD_LETTERS;
LocalizedString KEYBOARD_LETTERS;
ActorFrame m_Keyboard[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].Load( THEME->GetPathG( "ScreenSelectMusic",
ssprintf("difficulty icons 1x%d",
NUM_DIFFICULTIES)) );
NUM_Difficulty)) );
SET_XY( m_DifficultyIcon[p] );
this->AddChild( &m_DifficultyIcon[p] );
ON_COMMAND( m_DifficultyIcon[p] );
@@ -365,20 +365,20 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
vector <Steps *> MultiSteps;
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES;
m_DC[pn] = NUM_Difficulty;
else
{
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;
for ( i=0; i<(int)MultiSteps.size(); ++i )
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]) )
{
@@ -387,8 +387,8 @@ void ScreenNetSelectMusic::MenuDown( const InputEventPlus &input )
}
}
//If failed to go up, loop
if ( i == NUM_DIFFICULTIES )
for (i = 0;i<NUM_DIFFICULTIES;i++)
if ( i == NUM_Difficulty )
for (i = 0;i<NUM_Difficulty;i++)
if (dcs[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] );
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 );
else
m_DifficultyMeters[pn].SetFromMeterAndDifficulty( 0, DIFFICULTY_BEGINNER );
@@ -525,21 +525,21 @@ void ScreenNetSelectMusic::MusicChanged()
vector <Steps *> MultiSteps;
MultiSteps = GAMESTATE->m_pCurSong->GetStepsByStepsType( st );
if (MultiSteps.size() == 0)
m_DC[pn] = NUM_DIFFICULTIES;
m_DC[pn] = NUM_Difficulty;
else
{
int i;
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;
for ( i=0; i<(int)MultiSteps.size(); ++i )
dcs[MultiSteps[i]->GetDifficulty()] = true;
for ( i=0; i<NUM_DIFFICULTIES; ++i )
for ( i=0; i<NUM_Difficulty; ++i )
if ( dcs[i] )
{
Target = (Difficulty)i;
@@ -550,7 +550,7 @@ void ScreenNetSelectMusic::MusicChanged()
}
}
if ( i == NUM_DIFFICULTIES )
if ( i == NUM_Difficulty )
m_DC[pn] = Target;
}
UpdateDifficulties( pn );
+1 -1
View File
@@ -71,7 +71,7 @@ void ScreenOptionsEditCourse::BeginScreen()
def.m_sName = "Type";
def.m_vsChoices.clear();
FOREACH_CourseType( i )
def.m_vsChoices.push_back( CourseTypeToThemedString(i) );
def.m_vsChoices.push_back( CourseTypeToLocalizedString(i) );
vDefs.push_back( def );
vHands.push_back( NULL );
@@ -91,7 +91,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
def.m_vsChoices.clear();
def.m_vsChoices.push_back( "(any)" );
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 );
vHands.push_back( NULL );
@@ -114,7 +114,7 @@ void ScreenOptionsEditCourseEntry::BeginScreen()
def.m_sName = "Sort";
def.m_vsChoices.clear();
FOREACH_SongSort( i )
def.m_vsChoices.push_back( SongSortToThemedString(i) );
def.m_vsChoices.push_back( SongSortToLocalizedString(i) );
vDefs.push_back( def );
vHands.push_back( NULL );
+1 -1
View File
@@ -198,7 +198,7 @@ void ScreenOptionsManageCourses::BeginScreen()
ASSERT(0);
case EditMode_Practice:
case EditMode_Home:
def.m_sName = CourseTypeToThemedString( (*c)->GetCourseType() );
def.m_sName = CourseTypeToLocalizedString( (*c)->GetCourseType() );
break;
case EditMode_Full:
if( (*c)->IsAnEdit() )
@@ -104,7 +104,7 @@ void ScreenOptionsManageEditSteps::BeginScreen()
def.m_bAllowThemeTitle = false; // not themable
def.m_sExplanationName = "Edit Steps";
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_bAllowThemeItems = false; // already themed
vDefs.push_back( def );
@@ -41,7 +41,7 @@ static const char *ProfileActionNames[] = {
"Clear",
};
XToString( ProfileAction, NUM_ProfileAction );
XToThemedString( ProfileAction, NUM_ProfileAction );
XToLocalizedString( ProfileAction );
#define FOREACH_ProfileAction( i ) FOREACH_ENUM( ProfileAction, NUM_ProfileAction, i )
static MenuDef g_TempMenu(
@@ -344,7 +344,7 @@ void ScreenOptionsManageProfiles::ProcessMenuStart( const InputEventPlus &input
g_TempMenu.rows.clear();
#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_SetDefaultP2 );
+2 -2
View File
@@ -196,7 +196,7 @@ float ScreenRanking::SetPage( const PageToShow &pts )
//
// init page
//
m_textStepsType.SetText( GameManager::StepsTypeToThemedString(pts.st) );
m_textStepsType.SetText( GameManager::StepsTypeToLocalizedString(pts.st) );
return 0;
}
@@ -351,7 +351,7 @@ void ScoreScroller::Load(
ItemTemplate.m_textTitle.LoadFromFont( THEME->GetPathF(sClassName,"list title") );
ActorUtil::LoadAllCommands( ItemTemplate.m_textTitle, sClassName );
ItemTemplate.m_textScore.resize( NUM_DIFFICULTIES );
ItemTemplate.m_textScore.resize( NUM_Difficulty );
FOREACH_CONST( Difficulty, m_DifficultiesToShow, d )
{
ItemTemplate.m_textScore[*d].SetName( "Score" );
+3 -3
View File
@@ -83,7 +83,7 @@ protected:
ThemeMetric<bool> SHOW_ONLY_MOST_RECENT_SCORES;
ThemeMetric<float> SECONDS_PER_PAGE;
ThemeMetric<float> PAGE_FADE_SECONDS;
ThemeMetric<CString> NO_SCORE_NAME;
LocalizedString NO_SCORE_NAME;
ThemeMetric<bool> MANUAL_SCROLLING;
};
@@ -128,7 +128,7 @@ protected:
ThemeMetric<float> SCORE_OFFSET_START_X;
ThemeMetric<float> SCORE_OFFSET_Y;
ThemeMetric<bool> SHOW_SURVIVAL_TIME;
ThemeMetric<CString> NO_SCORE_NAME;
LocalizedString NO_SCORE_NAME;
ThemeMetric<float> COL_SPACING_X;
ThemeMetric<float> SONG_SCORE_SECONDS_PER_ROW;
ThemeMetric<int> m_metricSongScoreRowsToDraw;
@@ -151,7 +151,7 @@ private:
ScoreScroller m_ListScoreRowItems;
AutoActor m_sprDifficulty[NUM_DIFFICULTIES]; // for all_steps
AutoActor m_sprDifficulty[NUM_Difficulty]; // for all_steps
ThemeMetricDifficultiesToShow DIFFICULTIES_TO_SHOW;
ThemeMetric<float> COL_SPACING_X;
+1 -1
View File
@@ -223,7 +223,7 @@ void ScreenSelectMusic::Init()
this->AddChild( &m_sprDifficultyFrame[p] );
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] );
this->AddChild( &m_DifficultyIcon[p] );
+13 -12
View File
@@ -8,6 +8,7 @@
#include "Quad.h"
#include "ThemeMetric.h"
#include "AutoActor.h"
#include "LocalizedString.h"
class ScreenSystemLayer : public Screen
{
@@ -28,18 +29,18 @@ private:
CString GetCreditsMessage( PlayerNumber pn ) const;
ThemeMetric<CString> CREDITS_PRESS_START;
ThemeMetric<CString> CREDITS_INSERT_CARD;
ThemeMetric<CString> CREDITS_CARD_TOO_LATE;
ThemeMetric<CString> CREDITS_CARD_NO_NAME;
ThemeMetric<CString> CREDITS_CARD_READY;
ThemeMetric<CString> CREDITS_CARD_CHECKING;
ThemeMetric<CString> CREDITS_CARD_REMOVED;
ThemeMetric<CString> CREDITS_FREE_PLAY;
ThemeMetric<CString> CREDITS_CREDITS;
ThemeMetric<CString> CREDITS_NOT_PRESENT;
ThemeMetric<CString> CREDITS_LOAD_FAILED;
ThemeMetric<CString> CREDITS_LOADED_FROM_LAST_GOOD_APPEND;
LocalizedString CREDITS_PRESS_START;
LocalizedString CREDITS_INSERT_CARD;
LocalizedString CREDITS_CARD_TOO_LATE;
LocalizedString CREDITS_CARD_NO_NAME;
LocalizedString CREDITS_CARD_READY;
LocalizedString CREDITS_CARD_CHECKING;
LocalizedString CREDITS_CARD_REMOVED;
LocalizedString CREDITS_FREE_PLAY;
LocalizedString CREDITS_CREDITS;
LocalizedString CREDITS_NOT_PRESENT;
LocalizedString CREDITS_LOAD_FAILED;
LocalizedString CREDITS_LOADED_FROM_LAST_GOOD_APPEND;
ThemeMetric<bool> CREDITS_JOIN_ONLY;
};
+5 -4
View File
@@ -12,9 +12,10 @@
#include "Foreach.h"
#include "UnlockManager.h"
#include "ThemeMetric.h"
#include "LocalizedString.h"
static ThemeMetric<CString> SORT_NOT_AVAILABLE( "Sort", "NotAvailable" );
static ThemeMetric<CString> SORT_OTHER ( "Sort", "Other" );
static LocalizedString SORT_NOT_AVAILABLE( "Sort", "NotAvailable" );
static LocalizedString SORT_OTHER ( "Sort", "Other" );
/////////////////////////////////////
// Sorting
@@ -273,9 +274,9 @@ CString SongUtil::GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so
{
Grade g = (Grade)i;
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:
{
+4 -4
View File
@@ -42,9 +42,9 @@ void StageStats::AssertValid( PlayerNumber pn ) const
CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() );
ASSERT( m_player[pn].vpPlayedSteps.size() != 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_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( vpPossibleSongs.size() == m_player[pn].vpPossibleSteps.size() );
}
@@ -57,9 +57,9 @@ void StageStats::AssertValid( MultiPlayer pn ) const
CHECKPOINT_M( vpPlayedSongs[0]->GetTranslitFullTitle() );
ASSERT( m_multiPlayer[pn].vpPlayedSteps.size() != 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_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( 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
# Begin Special Build Tool
IntDir=.\../Debug6
TargetDir=\SM Source\stepmania\Program
TargetDir=\cvs\stepmania\Program
TargetName=StepMania-debug
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
# End Special Build Tool
@@ -96,10 +96,10 @@ LINK32=link.exe
# SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool
IntDir=.\../Release6
TargetDir=\SM Source\stepmania\Program
TargetDir=\cvs\stepmania\Program
TargetName=StepMania
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
# End Special Build Tool
@@ -1220,6 +1220,10 @@ SOURCE=.\StyleUtil.h
# End Source File
# Begin Source File
SOURCE=.\ThemeMetric.h
# End Source File
# Begin Source File
SOURCE=.\TimingData.cpp
# End Source File
# Begin Source File
+3 -3
View File
@@ -104,15 +104,15 @@ float Steps::PredictMeter() const
{
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,
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];
const float DifficultyCoeffs[NUM_DIFFICULTIES] =
const float DifficultyCoeffs[NUM_Difficulty] =
{
-0.877f, -0.877f, 0, 0.722f, 0.722f, 0
};