From c6fb8a11b96ae4ff5aa07e45afe30ef6382f706e Mon Sep 17 00:00:00 2001 From: sillybear Date: Thu, 4 Dec 2014 02:46:01 +0800 Subject: [PATCH] Allow setting of game type via console command --- src/StepMania.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 5b71540a01..a4085e9b6e 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -821,6 +821,7 @@ void StepMania::InitializeCurrentGame( const Game* g ) RString sAnnouncer = PREFSMAN->m_sAnnouncer; RString sTheme = PREFSMAN->m_sTheme; + RString sGametype = GAMESTATE->GetCurrentGame()->m_szName; RString sLanguage = PREFSMAN->m_sLanguage; if( sAnnouncer.empty() ) @@ -828,8 +829,16 @@ void StepMania::InitializeCurrentGame( const Game* g ) // It doesn't matter if sTheme is blank or invalid, THEME->STAL will set // a selectable theme for us. -Kyz - // process theme and language command line arguments; + // process gametype, theme and language command line arguments; // these change the preferences in order for transparent loading -aj + RString argCurGame; + if( GetCommandlineArgument( "game", &argCurGame) && argCurGame != sGametype ) + { + sGametype = argCurGame; + // set game type in preferences too for correct behavior + PREFSMAN->SetCurrentGame( sGametype ); + } + RString argTheme; if( GetCommandlineArgument( "theme",&argTheme) && argTheme != sTheme ) {