Allow setting of game type via console command

This commit is contained in:
sillybear
2014-12-04 02:46:01 +08:00
parent 89864fc890
commit c6fb8a11b9
+10 -1
View File
@@ -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 )
{