From 174062553b55d6f2f10e2b741b980bea72f80353 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 25 Jan 2004 16:48:09 +0000 Subject: [PATCH] add "song" --- stepmania/src/ModeChoice.cpp | 13 +++++++++++++ stepmania/src/ModeChoice.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/stepmania/src/ModeChoice.cpp b/stepmania/src/ModeChoice.cpp index f18d91a4cc..31334b89cf 100644 --- a/stepmania/src/ModeChoice.cpp +++ b/stepmania/src/ModeChoice.cpp @@ -26,6 +26,7 @@ void ModeChoice::Init() m_sModifiers = ""; m_sAnnouncer = ""; m_sScreen = ""; + m_pSong = NULL; m_pSteps = NULL; m_pCharacter = NULL; m_CourseDifficulty = COURSE_DIFFICULTY_INVALID; @@ -78,6 +79,8 @@ bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const return false; } + if( m_pSong && GAMESTATE->m_pCurSong != m_pSong ) + return false; if( m_pSteps && GAMESTATE->m_pCurNotes[pn] != m_pSteps ) return false; if( m_pCharacter && GAMESTATE->m_pCurCharacters[pn] != m_pCharacter ) @@ -161,6 +164,13 @@ void ModeChoice::Load( int iIndex, CString sChoice ) m_sModifiers += sValue; } + if( sName == "song" ) + { + m_pSong = SONGMAN->FindSong( sValue ); + if( m_pSong == NULL ) + m_bInvalid |= true; + } + if( sName == "screen" ) m_sScreen = sValue; } @@ -285,6 +295,8 @@ void ModeChoice::Apply( PlayerNumber pn ) const ANNOUNCER->SwitchAnnouncer( m_sAnnouncer ); if( m_sModifiers != "" ) GAMESTATE->ApplyModifiers( pn, m_sModifiers ); + if( m_pSong ) + GAMESTATE->m_pCurSong = m_pSong; if( m_pSteps ) GAMESTATE->m_pCurNotes[pn] = m_pSteps; if( m_pCharacter ) @@ -321,6 +333,7 @@ bool ModeChoice::IsZero() const m_dc != DIFFICULTY_INVALID || m_sAnnouncer != "" || m_sModifiers != "" || + m_pSong != NULL || m_pSteps != NULL || m_pCharacter != NULL || m_CourseDifficulty != COURSE_DIFFICULTY_INVALID ) diff --git a/stepmania/src/ModeChoice.h b/stepmania/src/ModeChoice.h index 128e98d04a..70caa5a7f2 100644 --- a/stepmania/src/ModeChoice.h +++ b/stepmania/src/ModeChoice.h @@ -16,6 +16,7 @@ #include "GameConstantsAndTypes.h" #include "PlayerNumber.h" +class Song; class Steps; class Character; @@ -42,6 +43,7 @@ struct ModeChoice // used in SelectMode CString m_sAnnouncer; CString m_sModifiers; CString m_sScreen; + Song* m_pSong; Steps* m_pSteps; Character* m_pCharacter; CourseDifficulty m_CourseDifficulty;