From b730af5e8a631cc9e1d7b7d22372cb935d124fa8 Mon Sep 17 00:00:00 2001 From: briaguya Date: Tue, 28 Jun 2022 08:15:26 -0400 Subject: [PATCH] implement reset --- libultraship/libultraship/ImGuiImpl.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 1867059a4..1fdf1dc81 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -55,6 +55,7 @@ bool oldCursorState = true; OSContPad* pads; std::map DefaultAssets; +std::vector noArgs; namespace SohImGui { @@ -753,6 +754,12 @@ namespace SohImGui { ShowCursor(menu_bar, Dialogues::dMenubar); } + if ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || + ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && + ImGui::IsKeyPressed(ImGuiKey_R, false)) { + console->Commands["reset"].handler(noArgs); + } + if (ImGui::BeginMenuBar()) { if (DefaultAssets.contains("Game_Icon")) { ImGui::SetCursorPos(ImVec2(5, 2.5f)); @@ -760,15 +767,19 @@ namespace SohImGui { ImGui::SameLine(); ImGui::SetCursorPos(ImVec2(25, 0)); } + if (ImGui::BeginMenu("Shipwright")) { - if (ImGui::MenuItem("Reset")) { - // TODO: RESET FROM HERE - } - if (ImGui::MenuItem("Exit")) { - // TODO: EXIT FROM HERE + if (ImGui::MenuItem("Reset", + #if __APPLE__ + "⌘ R" + #else + "Ctrl+R" + #endif + )) { + console->Commands["reset"].handler(noArgs); } ImGui::EndMenu(); - } + } if (ImGui::BeginMenu("Audio")) { EnhancementSliderFloat("Master Volume: %d %%", "##Master_Vol", "gGameMasterVolume", 0.0f, 1.0f, "", 1.0f, true);