diff --git a/stepmania/src/GameCommand.cpp b/stepmania/src/GameCommand.cpp index 8732e7790a..d9310118f2 100644 --- a/stepmania/src/GameCommand.cpp +++ b/stepmania/src/GameCommand.cpp @@ -53,6 +53,7 @@ void GameCommand::Init() m_bInsertCredit = false; m_bStopMusic = false; + m_bApplyDefaultOptions = false; } class SongOptions; @@ -357,6 +358,11 @@ void GameCommand::LoadOne( const Command& cmd ) m_bStopMusic = true; } + else if( sName == "applydefaultoptions" ) + { + m_bApplyDefaultOptions = true; + } + else { CString sWarning = ssprintf( "Command '%s' is not valid.", cmd.GetOriginalCommandString().c_str() ); @@ -722,6 +728,12 @@ void GameCommand::ApplySelf( const vector &vpns ) const { InsertCredit(); } + if( m_bApplyDefaultOptions ) + { + FOREACH_PlayerNumber( p ) + GAMESTATE->GetDefaultPlayerOptions( GAMESTATE->m_pPlayerState[p]->m_PlayerOptions ); + GAMESTATE->GetDefaultSongOptions( GAMESTATE->m_SongOptions ); + } // HACK: Set life type to BATTERY just once here so it happens once and // we don't override the user's changes if they back out. if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI && diff --git a/stepmania/src/GameCommand.h b/stepmania/src/GameCommand.h index 7b85c1e0da..8189536a88 100644 --- a/stepmania/src/GameCommand.h +++ b/stepmania/src/GameCommand.h @@ -78,6 +78,7 @@ public: bool m_bInsertCredit; bool m_bStopMusic; + bool m_bApplyDefaultOptions; // Lua void PushSelf( lua_State *L );