From e0173cbb4d6b7489fc4dbbb5aae8c70d995d4f8d Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 21 Oct 2019 00:38:20 +1000 Subject: [PATCH] Frontend: Popup menu for load state in powered-off state --- src/duckstation/sdl_interface.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/duckstation/sdl_interface.cpp b/src/duckstation/sdl_interface.cpp index e8984ee3e..6d7335186 100644 --- a/src/duckstation/sdl_interface.cpp +++ b/src/duckstation/sdl_interface.cpp @@ -733,7 +733,17 @@ void SDLInterface::DrawPoweredOffWindow() ImGui::NewLine(); ImGui::SetCursorPosX(button_left); - ImGui::Button("Load State", button_size); + if (ImGui::Button("Load State", button_size)) + ImGui::OpenPopup("PowerOffWindow_LoadStateMenu"); + if (ImGui::BeginPopup("PowerOffWindow_LoadStateMenu")) + { + for (u32 i = 1; i <= NUM_QUICK_SAVE_STATES; i++) + { + if (ImGui::MenuItem(TinyString::FromFormat("State %u", i).GetCharArray())) + DoLoadState(i); + } + ImGui::EndPopup(); + } ImGui::NewLine(); ImGui::SetCursorPosX(button_left);