From 7856c7c53452bad8bf7ca33b6b4b62a4f48b6514 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 31 Mar 2005 21:25:15 +0000 Subject: [PATCH] use modifiers only in playback/record, not in edit --- stepmania/src/GameState.cpp | 11 +++++++++++ stepmania/src/GameState.h | 1 + stepmania/src/ScreenEdit.cpp | 14 +++++++++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 27789cb344..8f065058cd 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -1032,6 +1032,17 @@ void GameState::RestoreSelectedOptions() m_SongOptions = m_StoredSongOptions; } +void GameState::ResetCurrentOptions() +{ + FOREACH_PlayerNumber( p ) + { + m_pPlayerState[p]->m_PlayerOptions.Init(); + m_pPlayerState[p]->m_PlayerOptions.FromString( PREFSMAN->m_sDefaultModifiers ); + } + m_SongOptions.Init(); + m_SongOptions.FromString( PREFSMAN->m_sDefaultModifiers ); +} + bool GameState::IsDisqualified( PlayerNumber pn ) { if( !PREFSMAN->m_bDisqualification ) diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index 28e18d4ce6..396bcf5667 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -205,6 +205,7 @@ public: void ApplyModifiers( PlayerNumber pn, CString sModifiers ); void StoreSelectedOptions(); void RestoreSelectedOptions(); + void ResetCurrentOptions(); bool IsDisqualified( PlayerNumber pn ); diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index a0c1c24a0b..83d2dea474 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -55,7 +55,7 @@ AutoScreenMessage( SM_BackFromEditOptions ) AutoScreenMessage( SM_BackFromSongInformation ) AutoScreenMessage( SM_BackFromBGChange ) AutoScreenMessage( SM_BackFromInsertAttack ) -AutoScreenMessage( SM_BackFromInsertAttackModifiers ) +AutoScreenMessage( SM_BackFromInsertAttackPlayerOptions ) AutoScreenMessage( SM_BackFromPrefs ) AutoScreenMessage( SM_BackFromCourseModeMenu ) AutoScreenMessage( SM_DoRevertToLastSave ) @@ -920,7 +920,6 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ { fScrollSpeed = fNewScrollSpeed; m_soundMarker.Play(); - GAMESTATE->StoreSelectedOptions(); } break; } @@ -1462,10 +1461,14 @@ void ScreenEdit::TransitionEditMode( EditMode em ) CheckNumberOfNotesAndUndo(); } + + GAMESTATE->ResetCurrentOptions(); break; case MODE_RECORDING: + GAMESTATE->RestoreSelectedOptions(); break; case MODE_PLAYING: + GAMESTATE->RestoreSelectedOptions(); break; default: ASSERT(0); @@ -1561,8 +1564,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) SM == SM_BackFromPlayerOptions || SM == SM_BackFromSongOptions ) { - // coming back from PlayerOptions or SongOptions GAMESTATE->StoreSelectedOptions(); + GAMESTATE->ResetCurrentOptions(); // stop any music that screen may have been playing SOUND->StopMusic(); @@ -1572,11 +1575,12 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) int iDurationChoice = ScreenMiniMenu::s_viLastAnswers[0]; g_fLastInsertAttackDurationSeconds = strtof( g_InsertAttack.rows[0].choices[iDurationChoice], NULL ); GAMESTATE->StoreSelectedOptions(); // save so that we don't lose the options chosen for edit and playback + GAMESTATE->ResetCurrentOptions(); // XXX: Fix me - //SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertAttackModifiers ); + //SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertAttackPlayerOptions ); } - else if( SM == SM_BackFromInsertAttackModifiers ) + else if( SM == SM_BackFromInsertAttackPlayerOptions ) { PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; CString sMods = poChosen.GetString();