diff --git a/stepmania/src/ModeChoice.cpp b/stepmania/src/ModeChoice.cpp index 26772b6d32..46c76bed9d 100644 --- a/stepmania/src/ModeChoice.cpp +++ b/stepmania/src/ModeChoice.cpp @@ -16,6 +16,8 @@ void ModeChoice::Init() { + m_sName = ""; + m_bInvalid = true; m_iIndex = -1; m_game = GAME_INVALID; m_style = STYLE_INVALID; @@ -23,9 +25,9 @@ void ModeChoice::Init() m_dc = DIFFICULTY_INVALID; m_sModifiers = ""; m_sAnnouncer = ""; - m_sName = ""; m_sScreen = ""; - m_bInvalid = true; + m_pSteps = NULL; + m_pCharacter = NULL; } bool CompareSongOptions( const SongOptions &so1, const SongOptions &so2 ); @@ -71,6 +73,11 @@ bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const return false; } + if( m_pSteps && GAMESTATE->m_pCurNotes[pn] != m_pSteps ) + return false; + if( m_pCharacter && GAMESTATE->m_pCurCharacters[pn] != m_pCharacter ) + return false; + return true; } @@ -270,6 +277,10 @@ void ModeChoice::Apply( PlayerNumber pn ) const ANNOUNCER->SwitchAnnouncer( m_sAnnouncer ); if( m_sModifiers != "" ) GAMESTATE->ApplyModifiers( pn, m_sModifiers ); + if( m_pSteps ) + GAMESTATE->m_pCurNotes[pn] = m_pSteps; + if( m_pCharacter ) + GAMESTATE->m_pCurCharacters[pn] = m_pCharacter; // 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. diff --git a/stepmania/src/ModeChoice.h b/stepmania/src/ModeChoice.h index 024582e7ef..80836c1818 100644 --- a/stepmania/src/ModeChoice.h +++ b/stepmania/src/ModeChoice.h @@ -16,6 +16,9 @@ #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" +class Steps; +class Character; + struct ModeChoice // used in SelectMode { ModeChoice() { Init(); } @@ -29,6 +32,7 @@ struct ModeChoice // used in SelectMode bool IsPlayable( CString *why = NULL ) const; bool IsZero() const; + CString m_sName; // display name bool m_bInvalid; int m_iIndex; Game m_game; @@ -38,7 +42,8 @@ struct ModeChoice // used in SelectMode CString m_sAnnouncer; CString m_sModifiers; CString m_sScreen; - CString m_sName; + Steps* m_pSteps; + Character* m_pCharacter; }; #endif