diff --git a/src/GameState.cpp b/src/GameState.cpp index 242ccaee70..4a521e1ebb 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -127,7 +127,8 @@ GameState::GameState() : m_pEditSourceSteps( Message_EditSourceStepsChanged ), m_stEditSource( Message_EditSourceStepsTypeChanged ), m_iEditCourseEntryIndex( Message_EditCourseEntryIndexChanged ), - m_sEditLocalProfileID( Message_EditLocalProfileIDChanged ) + m_sEditLocalProfileID( Message_EditLocalProfileIDChanged ), + m_bIsEditorStepTiming( false ) { g_pImpl = new GameStateImpl; diff --git a/src/GameState.h b/src/GameState.h index 000219a343..592b613dfe 100644 --- a/src/GameState.h +++ b/src/GameState.h @@ -44,7 +44,8 @@ public: void ResetPlayer( PlayerNumber pn ); void ApplyCmdline(); // called by Reset void ApplyGameCommand( const RString &sCommand, PlayerNumber pn=PLAYER_INVALID ); - void BeginGame(); // called when first player joins + /** @brief Start the game when the first player joins in. */ + void BeginGame(); void JoinPlayer( PlayerNumber pn ); void UnjoinPlayer( PlayerNumber pn ); bool JoinInput( PlayerNumber pn ); @@ -56,13 +57,25 @@ public: bool HaveProfileToSave(); void SaveLocalData(); void LoadCurrentSettingsFromProfile( PlayerNumber pn ); - void SaveCurrentSettingsToProfile( PlayerNumber pn ); // called at the beginning of each stage + /** + * @brief Save the specified player's settings to his/her profile. + * + * This is called at the beginning of each stage. + * @param pn the PlayerNumber to save the stats to. */ + void SaveCurrentSettingsToProfile( PlayerNumber pn ); Song* GetDefaultSong() const; void Update( float fDelta ); // Main state info - void SetCurGame( const Game *pGame ); // Call this instead of m_pCurGame.Set to make sure PREFSMAN->m_sCurrentGame stays in sync + + /** + * @brief State what the current game is. + * + * Call this instead of m_pCurGame.Set to make sure that + * PREFSMAN->m_sCurrentGame stays in sync. + * @param pGame the game to start using. */ + void SetCurGame( const Game *pGame ); BroadcastOnChangePtr m_pCurGame; BroadcastOnChangePtr m_pCurStyle; /** @brief Determine which side is joined. @@ -130,6 +143,9 @@ public: bool IsCourseMode() const; bool IsBattleMode() const; // not Rave + /** + * @brief Do we show the W1 timing judgment? + * @return true if we do, or false otherwise. */ bool ShowW1() const; BroadcastOnChange m_sPreferredSongGroup; // GROUP_ALL denotes no preferred group @@ -142,7 +158,11 @@ public: SortOrder m_PreferredSortOrder; // used by MusicWheel EditMode m_EditMode; bool IsEditing() const { return m_EditMode != EditMode_Invalid; } - bool m_bDemonstrationOrJukebox; // ScreenGameplay does special stuff when this is true + /** + * @brief Are we in the demonstration or jukebox mode? + * + * ScreenGameplay often does special things when this is set to true. */ + bool m_bDemonstrationOrJukebox; bool m_bJukeboxUsesModifiers; int m_iNumStagesOfThisSong; /** @@ -240,8 +260,11 @@ public: // Options stuff ModsGroup m_SongOptions; - // True if the current mode has changed the default NoteSkin, such as Edit/Sync Songs does. - // Note: any mode that wants to use it must set it + /** + * @brief Did the current game mode change the default Noteskin? + * + * This is true if it has: see Edit/Sync Songs for a common example. + * Note: any mode that wants to use this must set it explicitly. */ bool m_bDidModeChangeNoteSkin; void GetDefaultPlayerOptions( PlayerOptions &po ); @@ -308,6 +331,12 @@ public: Premium GetPremium() const; // Edit stuff + + /** + * @brief Is the editor making changes to Song timing or Steps timing? + * + * Different options are available depending on this setting. */ + bool m_bIsEditorStepTiming; BroadcastOnChange m_stEdit; BroadcastOnChange m_cdEdit; BroadcastOnChangePtr m_pEditSourceSteps; diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index 221d527996..43f8b94d46 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -692,6 +692,8 @@ REGISTER_SCREEN_CLASS( ScreenEdit ); void ScreenEdit::Init() { m_pSoundMusic = NULL; + + GAMESTATE->m_bIsEditorStepTiming = true; SubscribeToMessage( "Judgment" ); @@ -849,6 +851,9 @@ ScreenEdit::~ScreenEdit() LOG->Trace( "ScreenEdit::~ScreenEdit()" ); m_pSoundMusic->StopPlaying(); + + // Reset the GameState variable in case it's needed elsewhere. + GAMESTATE->m_bIsEditorStepTiming = false; } void ScreenEdit::BeginScreen()