ImGuiOverlays: Make escape close save state selector

This commit is contained in:
Stenzek 2024-09-29 15:29:40 +10:00
parent e06f1f1002
commit d32143b319
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View File

@ -1107,7 +1107,15 @@ void SaveStateSelectorUI::Draw()
// auto-close // auto-close
s_open_time += io.DeltaTime; s_open_time += io.DeltaTime;
if (s_open_time >= s_close_time) if (s_open_time >= s_close_time)
{
Close(); Close();
}
else if (ImGui::IsKeyPressed(ImGuiKey_Escape))
{
// Need to cancel the hotkey bindings, otherwise the pause menu will open.
InputManager::ClearBindStateFromSource(InputManager::MakeHostKeyboardKey(0));
Close();
}
} }
s32 SaveStateSelectorUI::GetCurrentSlot() s32 SaveStateSelectorUI::GetCurrentSlot()

View File

@ -1142,7 +1142,7 @@ void InputManager::ClearBindStateFromSource(InputBindingKey key)
if (current_mask == binding->full_mask) if (current_mask == binding->full_mask)
{ {
std::get<InputButtonEventHandler>(binding->handler)(0); std::get<InputButtonEventHandler>(binding->handler)(-1);
matched = true; matched = true;
break; break;
} }