diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 264734027c..fb21ad8707 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -71,6 +71,7 @@ VersionOnCommand=horizalign,right;x,620;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shad SongsOnCommand=horizalign,left;x,20;y,20;diffuse,0.6,0.6,0.6,1;zoom,0.5;shadowlength,2 MaxStagesOnCommand=hidden,1 MaxStagesText= +LifeDifficultyOnCommand=hidden,1 ChoicesX=320 ChoicesStartY=86 ChoicesSpacingY=48 diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 7613986e06..daf9b673ff 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -292,7 +292,7 @@ static void JudgeDifficulty( int &sel, bool ToSel, const CStringArray &choices ) MoveMap( sel, PREFSMAN->m_fJudgeWindowScale, ToSel, mapping, ARRAYSIZE(mapping) ); } -static void LifeDifficulty( int &sel, bool ToSel, const CStringArray &choices ) +void LifeDifficulty( int &sel, bool ToSel, const CStringArray &choices ) { const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f }; MoveMap( sel, PREFSMAN->m_fLifeDifficultyScale, ToSel, mapping, ARRAYSIZE(mapping) ); diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index b54c61b3a7..720eaf93c4 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -52,6 +52,11 @@ private: void (*MakeOptionsListCB)( CStringArray &out ); }; + +// HACK: This is used by ScreenTitleMenu +void LifeDifficulty( int &sel, bool ToSel, const CStringArray &choices ); + + #endif /* diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 839a1dbdce..be170e46df 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -22,6 +22,7 @@ #include "CodeDetector.h" #include "CommonMetrics.h" #include "Game.h" +#include "ScreenOptionsMasterPrefs.h" #define LOGO_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LogoOnCommand") @@ -30,6 +31,7 @@ #define SONGS_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","SongsOnCommand") #define MAX_STAGES_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","MaxStagesOnCommand") #define MAX_STAGES_TEXT THEME->GetMetric("ScreenTitleMenu","MaxStagesText") +#define LIFE_DIFFICULTY_ON_COMMAND THEME->GetMetric("ScreenTitleMenu","LifeDifficultyOnCommand") #define HELP_X THEME->GetMetricF("ScreenTitleMenu","HelpX") #define HELP_Y THEME->GetMetricF("ScreenTitleMenu","HelpY") #define CHOICES_X THEME->GetMetricF("ScreenTitleMenu","ChoicesX") @@ -116,6 +118,15 @@ ScreenTitleMenu::ScreenTitleMenu( CString sClassName ) : ScreenSelect( sClassNam m_textMaxStages.SetText( sText ); this->AddChild( &m_textMaxStages ); + m_textLifeDifficulty.LoadFromFont( THEME->GetPathF(m_sName,"LifeDifficulty") ); + m_textLifeDifficulty.Command( LIFE_DIFFICULTY_ON_COMMAND ); + int iLifeDifficulty; + const CStringArray dummy; + LifeDifficulty( iLifeDifficulty, true, dummy ); + iLifeDifficulty++; // LifeDifficulty returns an index + m_textLifeDifficulty.SetText( ssprintf( "life difficulty %d", iLifeDifficulty ) ); + this->AddChild( &m_textLifeDifficulty ); + CString sCoinMode = CoinModeToString((CoinMode)PREFSMAN->GetCoinMode()); m_CoinMode.LoadFromAniDir( THEME->GetPathToB("ScreenTitleMenu "+sCoinMode) ); this->AddChild( &m_CoinMode ); diff --git a/stepmania/src/ScreenTitleMenu.h b/stepmania/src/ScreenTitleMenu.h index ba3e16ae6e..2b5f9997ba 100644 --- a/stepmania/src/ScreenTitleMenu.h +++ b/stepmania/src/ScreenTitleMenu.h @@ -37,6 +37,7 @@ private: BitmapText m_textVersion; BitmapText m_textSongs; BitmapText m_textMaxStages; + BitmapText m_textLifeDifficulty; BitmapText m_textHelp; BitmapText m_textChoice[MAX_MODE_CHOICES];