From ab6f29ebd4928448595d85fa41e32deae529c2cb Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Wed, 20 Nov 2024 01:59:04 +0000 Subject: [PATCH] options_menu: fix being unable to press A at least once after opening the menu --- UnleashedRecomp/ui/options_menu.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index 0ef0c253..089fe49e 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -597,10 +597,6 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef* conf } } - // We've entered the menu now, no need to check this. - if (padState.IsReleased(SWA::eKeyState_A)) - g_isEnterKeyBuffered = false; - bool fadedOut = g_lockedOnOption && g_selectedItem != config; float alpha = fadedOut ? 0.5f : 1.0f; @@ -1019,9 +1015,15 @@ static void DrawInfoPanel() void OptionsMenu::Draw() { - if (!s_isVisible || SWA::CInputState::GetInstance()->GetPadState().IsDown(SWA::eKeyState_Y)) + auto pInputState = SWA::CInputState::GetInstance(); + + if (!s_isVisible || pInputState->GetPadState().IsDown(SWA::eKeyState_Y)) return; + // We've entered the menu now, no need to check this. + if (pInputState->GetPadState().IsReleased(SWA::eKeyState_A)) + g_isEnterKeyBuffered = false; + g_callbackDataIndex = 0; auto& res = ImGui::GetIO().DisplaySize;