diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 6b68d75f46..6e36f55d3e 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -364,12 +364,22 @@ static void JudgeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption MoveMap( sel, PREFSMAN->m_fJudgeWindowScale, ToSel, mapping, ARRAYSIZE(mapping) ); } -void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) +static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) { 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) ); } +static int GetLifeDifficulty() +{ + int iLifeDifficulty; + LifeDifficulty( iLifeDifficulty, true, NULL ); + iLifeDifficulty++; // LifeDifficulty returns an index + return iLifeDifficulty; +} +#include "LuaFunctions.h" +LuaFunction( GetLifeDifficulty, GetLifeDifficulty() ); + static void ShowSongOptions( int &sel, bool ToSel, const ConfOption *pConfOption ) { const PrefsManager::Maybe mapping[] = { PrefsManager::NO,PrefsManager::YES,PrefsManager::ASK }; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index aa179ed096..552e20b66e 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -61,11 +61,6 @@ struct ConfOption void (*MakeOptionsListCB)( CStringArray &out ); }; - -// HACK: This is used by ScreenTitleMenu -void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ); - - #endif /* diff --git a/stepmania/src/ScreenTitleMenu.cpp b/stepmania/src/ScreenTitleMenu.cpp index 8cb60e292b..e3f033d21e 100644 --- a/stepmania/src/ScreenTitleMenu.cpp +++ b/stepmania/src/ScreenTitleMenu.cpp @@ -19,7 +19,6 @@ #include "LightsManager.h" #include "CommonMetrics.h" #include "Game.h" -#include "ScreenOptionsMasterPrefs.h" #define MAX_STAGES_TEXT THEME->GetMetric (m_sName,"MaxStagesText") #define COIN_MODE_CHANGE_SCREEN THEME->GetMetric (m_sName,"CoinModeChangeScreen") @@ -68,25 +67,6 @@ void ScreenTitleMenu::Init() this->AddChild( &m_textSongs ); SET_XY_AND_ON_COMMAND( m_textSongs ); - m_textMaxStages.LoadFromFont( THEME->GetPathF(m_sName,"MaxStages") ); - m_textMaxStages.SetName( "MaxStages" ); - CString sText = - GAMESTATE->IsEventMode() ? - CString("event mode") : - ssprintf( "%d %s%s max", PREFSMAN->m_iSongsPerPlay.Get(), MAX_STAGES_TEXT.c_str(), (PREFSMAN->m_iSongsPerPlay>1)?"s":"" ); - m_textMaxStages.SetText( sText ); - this->AddChild( &m_textMaxStages ); - SET_XY_AND_ON_COMMAND( m_textMaxStages ); - - m_textLifeDifficulty.LoadFromFont( THEME->GetPathF(m_sName,"LifeDifficulty") ); - m_textLifeDifficulty.SetName( "LifeDifficulty" ); - int iLifeDifficulty; - LifeDifficulty( iLifeDifficulty, true, NULL ); - iLifeDifficulty++; // LifeDifficulty returns an index - m_textLifeDifficulty.SetText( ssprintf( "life difficulty %d", iLifeDifficulty ) ); - this->AddChild( &m_textLifeDifficulty ); - SET_XY_AND_ON_COMMAND( m_textLifeDifficulty ); - this->SortByDrawOrder(); SOUND->PlayOnceFromAnnouncer( "title menu game name" ); diff --git a/stepmania/src/ScreenTitleMenu.h b/stepmania/src/ScreenTitleMenu.h index f1c3018eb3..c46ce71e1c 100644 --- a/stepmania/src/ScreenTitleMenu.h +++ b/stepmania/src/ScreenTitleMenu.h @@ -26,8 +26,6 @@ private: AutoActor m_sprLogo; BitmapText m_textVersion; BitmapText m_textSongs; - BitmapText m_textMaxStages; - BitmapText m_textLifeDifficulty; }; #endif