From 953876393c27e163b9ec6c87df6140a5e709a4bc Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 29 May 2021 02:04:02 -0400 Subject: [PATCH] Add Help->ImGui->Clear Settings --- Runtime/CMain.cpp | 8 ++++++-- Runtime/ImGuiConsole.cpp | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Runtime/CMain.cpp b/Runtime/CMain.cpp index 6915878f4..1b8fecd91 100644 --- a/Runtime/CMain.cpp +++ b/Runtime/CMain.cpp @@ -188,8 +188,12 @@ private: as->specialKeyDown(key, mods, isRepeat); } } - if (key == boo::ESpecialKey::Enter && True(mods & boo::EModifierKey::Alt)) { - m_fullscreenToggleRequested = true; + if (True(mods & boo::EModifierKey::Alt)) { + if (key == boo::ESpecialKey::Enter) { + m_fullscreenToggleRequested = true; + } else if (key == boo::ESpecialKey::F4) { + m_windowInvalid = true; + } } m_imguiCallback.specialKeyDown(key, mods, isRepeat); } diff --git a/Runtime/ImGuiConsole.cpp b/Runtime/ImGuiConsole.cpp index 4d0a194c1..a5559f9da 100644 --- a/Runtime/ImGuiConsole.cpp +++ b/Runtime/ImGuiConsole.cpp @@ -8,6 +8,11 @@ #include "ImGuiEngine.hpp" +namespace ImGui { +// Internal functions +void ClearIniSettings(); +} + #include "TCastTo.hpp" // Generated file, do not modify include path namespace metaforce { @@ -586,8 +591,6 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) { ImGui::MenuItem("Inspect", nullptr, &m_showInspectWindow, canInspect); ImGui::MenuItem("Items", nullptr, &m_showItemsWindow, canInspect); ImGui::MenuItem("Layers", nullptr, &m_showLayersWindow, canInspect); - ImGui::Separator(); - ImGui::MenuItem("Demo", nullptr, &m_showDemoWindow); ImGui::EndMenu(); } if (ImGui::BeginMenu("Debug")) { @@ -623,6 +626,14 @@ void ImGuiConsole::ShowAppMainMenuBar(bool canInspect) { ImGui::Spacing(); if (ImGui::BeginMenu("Help")) { ImGui::MenuItem("About", nullptr, &m_showAboutWindow); + ImGui::Separator(); + if (ImGui::BeginMenu("ImGui")) { + if (ImGui::MenuItem("Clear Settings")) { + ImGui::ClearIniSettings(); + } + ImGui::MenuItem("Show Demo", nullptr, &m_showDemoWindow); + ImGui::EndMenu(); + } ImGui::EndMenu(); } ImGui::EndMainMenuBar();