diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 93af05977d..bc3b3d65db 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -14,6 +14,9 @@ StepMania 5.0 ????????? | 20110??? StepsUseChartName. Use this if you want your charts to have a unique name in the options menu. If there is no #CHARTNAME or it is "Blank", it reverts to the original behavior. This metric is false by default. [Wolfman2000] +* [ScreenEdit] Fixed a bug involving #ATTACKS. Now when you set an attack, + the mods are reverted back to how they were prior to the attack being set. + [Wolfman2000] 2011/07/09 ---------- diff --git a/src/ScreenEdit.cpp b/src/ScreenEdit.cpp index f26f594f89..77c029b253 100644 --- a/src/ScreenEdit.cpp +++ b/src/ScreenEdit.cpp @@ -884,6 +884,8 @@ void ScreenEdit::Init() PO_GROUP_ASSIGN( m_PlayerStateEdit.m_PlayerOptions, ModsLevel_Stage, m_sNoteSkin, GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetStage().m_sNoteSkin ); } m_PlayerStateEdit.m_PlayerOptions.FromString( ModsLevel_Stage, EDIT_MODIFIERS ); + + this->originalPlayerOptions.FromString(ModsLevel_Stage, EDIT_MODIFIERS); m_pSteps->GetNoteData( m_NoteDataEdit ); m_NoteFieldEdit.SetXY( EDIT_X, EDIT_Y ); @@ -2253,9 +2255,11 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) } } + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); g_fLastInsertAttackPositionSeconds = start; g_fLastInsertAttackDurationSeconds = end - start; - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Stage, po ); + toEdit.Assign( ModsLevel_Stage, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); break; } @@ -3172,11 +3176,13 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } else { + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); PlayerOptions po; if (iAttack >= 0) po.FromString(attacks[iAttack].sModifiers); - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po ); + toEdit.Assign( ModsLevel_Preferred, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); } } @@ -3211,7 +3217,8 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) } else if (SM == SM_BackFromInsertStepAttackPlayerOptions) { - PlayerOptions poChosen = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.GetPreferred(); + ModsGroup &toRestore = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + PlayerOptions poChosen = toRestore.GetPreferred(); RString mods = poChosen.GetString(); if (g_fLastInsertAttackPositionSeconds >= 0) @@ -3229,6 +3236,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM ) else attacks.push_back(a); } + toRestore.Assign(ModsLevel_Preferred, this->originalPlayerOptions.GetPreferred()); } else if( SM == SM_BackFromInsertCourseAttackPlayerOptions ) { @@ -4139,11 +4147,13 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const vector &iAn m_pSteps->m_Attacks : m_pSong->m_Attacks; int iAttack = FindAttackAtTime(attacks, start); + ModsGroup &toEdit = GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions; + this->originalPlayerOptions.Assign(ModsLevel_Preferred, toEdit.GetPreferred()); PlayerOptions po; if (iAttack >= 0) po.FromString(attacks[iAttack].sModifiers); - GAMESTATE->m_pPlayerState[PLAYER_1]->m_PlayerOptions.Assign( ModsLevel_Preferred, po ); + toEdit.Assign( ModsLevel_Preferred, po ); SCREENMAN->AddNewScreenToTop( "ScreenPlayerOptions", SM_BackFromInsertStepAttackPlayerOptions ); SetDirty(true); break; diff --git a/src/ScreenEdit.h b/src/ScreenEdit.h index 727341716b..606921ec32 100644 --- a/src/ScreenEdit.h +++ b/src/ScreenEdit.h @@ -266,6 +266,9 @@ protected: BitmapText m_textInputTips; + /** @brief The player options before messing with attacks. */ + ModsGroup originalPlayerOptions; + /** * @brief Keep a backup of the present Step TimingData when * entering a playing or recording state.