From bc65d16c4a1f1c07c427fc245f8cea23d8a4f4ab Mon Sep 17 00:00:00 2001 From: Crash Cringle <30600688+CrashCringle12@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:08:27 -0400 Subject: [PATCH] Move LastOpenSection declaration outside of if/else, add clarity to comment --- src/WheelBase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/WheelBase.cpp b/src/WheelBase.cpp index 067a2a7097..aeeebd5c51 100644 --- a/src/WheelBase.cpp +++ b/src/WheelBase.cpp @@ -288,16 +288,17 @@ bool WheelBase::Select() // return true if this selection can end the screen case WheelItemDataType_Section: { RString sThisItemSectionName = m_CurWheelItemData[m_iSelection]->m_sText; + // Keep track of the open section so that we can restore it + // when navigating back to ScreenSelectMusic. + GAMESTATE->sLastOpenSection = sThisItemSectionName; if( m_sExpandedSectionName == sThisItemSectionName ) // already expanded { - GAMESTATE->sLastOpenSection = sThisItemSectionName; // remember this section SetOpenSection( "" ); // collapse it m_soundCollapse.Play(true); } else // already collapsed { SetOpenSection( sThisItemSectionName ); // expand it - GAMESTATE->sLastOpenSection = sThisItemSectionName; // remember this section m_soundExpand.Play(true); } }