add "song"

This commit is contained in:
Glenn Maynard
2004-01-25 16:48:09 +00:00
parent 290d92f6e3
commit 174062553b
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -26,6 +26,7 @@ void ModeChoice::Init()
m_sModifiers = ""; m_sModifiers = "";
m_sAnnouncer = ""; m_sAnnouncer = "";
m_sScreen = ""; m_sScreen = "";
m_pSong = NULL;
m_pSteps = NULL; m_pSteps = NULL;
m_pCharacter = NULL; m_pCharacter = NULL;
m_CourseDifficulty = COURSE_DIFFICULTY_INVALID; m_CourseDifficulty = COURSE_DIFFICULTY_INVALID;
@@ -78,6 +79,8 @@ bool ModeChoice::DescribesCurrentMode( PlayerNumber pn ) const
return false; return false;
} }
if( m_pSong && GAMESTATE->m_pCurSong != m_pSong )
return false;
if( m_pSteps && GAMESTATE->m_pCurNotes[pn] != m_pSteps ) if( m_pSteps && GAMESTATE->m_pCurNotes[pn] != m_pSteps )
return false; return false;
if( m_pCharacter && GAMESTATE->m_pCurCharacters[pn] != m_pCharacter ) if( m_pCharacter && GAMESTATE->m_pCurCharacters[pn] != m_pCharacter )
@@ -161,6 +164,13 @@ void ModeChoice::Load( int iIndex, CString sChoice )
m_sModifiers += sValue; m_sModifiers += sValue;
} }
if( sName == "song" )
{
m_pSong = SONGMAN->FindSong( sValue );
if( m_pSong == NULL )
m_bInvalid |= true;
}
if( sName == "screen" ) if( sName == "screen" )
m_sScreen = sValue; m_sScreen = sValue;
} }
@@ -285,6 +295,8 @@ void ModeChoice::Apply( PlayerNumber pn ) const
ANNOUNCER->SwitchAnnouncer( m_sAnnouncer ); ANNOUNCER->SwitchAnnouncer( m_sAnnouncer );
if( m_sModifiers != "" ) if( m_sModifiers != "" )
GAMESTATE->ApplyModifiers( pn, m_sModifiers ); GAMESTATE->ApplyModifiers( pn, m_sModifiers );
if( m_pSong )
GAMESTATE->m_pCurSong = m_pSong;
if( m_pSteps ) if( m_pSteps )
GAMESTATE->m_pCurNotes[pn] = m_pSteps; GAMESTATE->m_pCurNotes[pn] = m_pSteps;
if( m_pCharacter ) if( m_pCharacter )
@@ -321,6 +333,7 @@ bool ModeChoice::IsZero() const
m_dc != DIFFICULTY_INVALID || m_dc != DIFFICULTY_INVALID ||
m_sAnnouncer != "" || m_sAnnouncer != "" ||
m_sModifiers != "" || m_sModifiers != "" ||
m_pSong != NULL ||
m_pSteps != NULL || m_pSteps != NULL ||
m_pCharacter != NULL || m_pCharacter != NULL ||
m_CourseDifficulty != COURSE_DIFFICULTY_INVALID ) m_CourseDifficulty != COURSE_DIFFICULTY_INVALID )
+2
View File
@@ -16,6 +16,7 @@
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PlayerNumber.h" #include "PlayerNumber.h"
class Song;
class Steps; class Steps;
class Character; class Character;
@@ -42,6 +43,7 @@ struct ModeChoice // used in SelectMode
CString m_sAnnouncer; CString m_sAnnouncer;
CString m_sModifiers; CString m_sModifiers;
CString m_sScreen; CString m_sScreen;
Song* m_pSong;
Steps* m_pSteps; Steps* m_pSteps;
Character* m_pCharacter; Character* m_pCharacter;
CourseDifficulty m_CourseDifficulty; CourseDifficulty m_CourseDifficulty;