re-add applydefaultoptions

This commit is contained in:
Chris Danford
2005-11-30 04:27:10 +00:00
parent bc1b00e437
commit 557ae44dc7
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -53,6 +53,7 @@ void GameCommand::Init()
m_bInsertCredit = false; m_bInsertCredit = false;
m_bStopMusic = false; m_bStopMusic = false;
m_bApplyDefaultOptions = false;
} }
class SongOptions; class SongOptions;
@@ -357,6 +358,11 @@ void GameCommand::LoadOne( const Command& cmd )
m_bStopMusic = true; m_bStopMusic = true;
} }
else if( sName == "applydefaultoptions" )
{
m_bApplyDefaultOptions = true;
}
else else
{ {
CString sWarning = ssprintf( "Command '%s' is not valid.", cmd.GetOriginalCommandString().c_str() ); CString sWarning = ssprintf( "Command '%s' is not valid.", cmd.GetOriginalCommandString().c_str() );
@@ -722,6 +728,12 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
{ {
InsertCredit(); 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 // 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. // we don't override the user's changes if they back out.
if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI && if( GAMESTATE->m_PlayMode == PLAY_MODE_ONI &&
+1
View File
@@ -78,6 +78,7 @@ public:
bool m_bInsertCredit; bool m_bInsertCredit;
bool m_bStopMusic; bool m_bStopMusic;
bool m_bApplyDefaultOptions;
// Lua // Lua
void PushSelf( lua_State *L ); void PushSelf( lua_State *L );