diff --git a/soh/soh/SohGui/Menu.cpp b/soh/soh/SohGui/Menu.cpp index e130d5b75..4dd939df8 100644 --- a/soh/soh/SohGui/Menu.cpp +++ b/soh/soh/SohGui/Menu.cpp @@ -581,22 +581,6 @@ void Menu::DrawElement() { headerHeight += style.ScrollbarSize; scrollbar = true; } - UIWidgets::ButtonOptions options = {}; - options.size = UIWidgets::Sizes::Inline; - options.tooltip = "Close Menu (Esc)"; - if (UIWidgets::Button(ICON_FA_TIMES_CIRCLE, options)) { - ToggleVisibility(); - - // Update gamepad navigation after close based on if other menus are still visible - auto mImGuiIo = &ImGui::GetIO(); - if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && - Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuOrMenubarVisible()) { - mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; - } else { - mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad; - } - } - ImGui::SameLine(); ImGui::SetNextWindowSizeConstraints({ 0, headerHeight }, { headerWidth, headerHeight }); ImVec2 headerSelSize = { menuSize.x - buttonSize.x * 3 - style.ItemSpacing.x * 3, headerHeight }; if (scrollbar) { @@ -657,7 +641,19 @@ void Menu::DrawElement() { ImGui::PopStyleColor(); } ImGui::EndChild(); - ImGui::SameLine(menuSize.x - (buttonSize.x * 2) - style.ItemSpacing.x); + ImGui::SameLine(menuSize.x - (buttonSize.x * 3) - (style.ItemSpacing.x * 2)); + UIWidgets::ButtonOptions options3 = {}; + options3.color = UIWidgets::Colors::Red; + options3.size = UIWidgets::Sizes::Inline; + options3.tooltip = "Quit SoH"; + if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) { + if (!popped) { + ToggleVisibility(); + } + Ship::Context::GetInstance()->GetWindow()->Close(); + } + ImGui::PopStyleVar(); + ImGui::SameLine(); UIWidgets::ButtonOptions options2 = {}; options2.color = UIWidgets::Colors::Red; options2.size = UIWidgets::Sizes::Inline; @@ -676,17 +672,21 @@ void Menu::DrawElement() { ->Dispatch("reset"); } ImGui::SameLine(); - UIWidgets::ButtonOptions options3 = {}; - options3.color = UIWidgets::Colors::Red; - options3.size = UIWidgets::Sizes::Inline; - options3.tooltip = "Quit SoH"; - if (UIWidgets::Button(ICON_FA_POWER_OFF, options3)) { - if (!popped) { - ToggleVisibility(); + UIWidgets::ButtonOptions options = {}; + options.size = UIWidgets::Sizes::Inline; + options.tooltip = "Close Menu (Esc)"; + if (UIWidgets::Button(ICON_FA_TIMES_CIRCLE, options)) { + ToggleVisibility(); + + // Update gamepad navigation after close based on if other menus are still visible + auto mImGuiIo = &ImGui::GetIO(); + if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuOrMenubarVisible()) { + mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; + } else { + mImGuiIo->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad; } - Ship::Context::GetInstance()->GetWindow()->Close(); } - ImGui::PopStyleVar(); pos.y += headerHeight + style.ItemSpacing.y; pos.x = centerX - menuSize.x / 2 + (style.ItemSpacing.x * (menuEntries.size() + 1)); diff --git a/soh/soh/SohGui/ResolutionEditor.cpp b/soh/soh/SohGui/ResolutionEditor.cpp index 8e850682c..e4f504ccd 100644 --- a/soh/soh/SohGui/ResolutionEditor.cpp +++ b/soh/soh/SohGui/ResolutionEditor.cpp @@ -517,7 +517,7 @@ void UpdateResolutionVars() { bool IsDroppingFrames() { // a rather imprecise way of checking for frame drops. // but it's mostly there to inform the player of large drops. - const short targetFPS = CVarGetInteger("gInterpolationFPS", 20); + const short targetFPS = OTRGlobals::Instance->GetInterpolationFPS(); const float threshold = targetFPS / 20.0f + 4.1f; return ImGui::GetIO().Framerate < targetFPS - threshold; } diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp index 5a186b0ae..81d5b5244 100644 --- a/soh/soh/SohGui/SohMenuSettings.cpp +++ b/soh/soh/SohGui/SohMenuSettings.cpp @@ -65,7 +65,7 @@ void SohMenu::AddMenuSettings() { AddWidget(path, "Menu Controller Navigation", WIDGET_CVAR_CHECKBOX) .CVar(CVAR_IMGUI_CONTROLLER_NAV) .Options(CheckboxOptions().Tooltip( - "Allows controller navigation of the 2Ship menu (Settings, Enhancements,...)\nCAUTION: " + "Allows controller navigation of the port menu (Settings, Enhancements,...)\nCAUTION: " "This will disable game inputs while the menu is visible.\n\nD-pad to move between " "items, A to select, B to move up in scope.")); AddWidget(path, "Cursor Always Visible", WIDGET_CVAR_CHECKBOX)