summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalkierian <malkierian@gmail.com>2025-03-16 15:00:30 -0700
committerGitHub <noreply@github.com>2025-03-16 23:00:30 +0100
commit05ab17d3a8fe26600ee4cee032de1c54d2c024f4 (patch)
tree108a1d0f1555f9c525b925322d939a510ed8cb62
parent112fab503ff0d427ee211a04d012bb3beec649fe (diff)
Reimplement ImGui Scaling option. (#5124)
-rw-r--r--soh/soh/SohGui/SohMenuBar.cpp20
-rw-r--r--soh/soh/SohGui/SohMenuSettings.cpp10
2 files changed, 10 insertions, 20 deletions
diff --git a/soh/soh/SohGui/SohMenuBar.cpp b/soh/soh/SohGui/SohMenuBar.cpp
index 18fa8b53d..ed63fea7b 100644
--- a/soh/soh/SohGui/SohMenuBar.cpp
+++ b/soh/soh/SohGui/SohMenuBar.cpp
@@ -68,8 +68,6 @@ static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames =
{ Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" },
};
-static const char* imguiScaleOptions[4] = { "Small", "Normal", "Large", "X-Large" };
-
static const char* filters[3] = {
#ifdef __WIIU__
"",
@@ -89,24 +87,6 @@ Ship::WindowBackend configWindowBackend;
extern std::shared_ptr<Ship::GuiWindow> mGfxDebuggerWindow;
void DrawSettingsMenu() {
- //if (ImGui::BeginMenu("Settings"))
- //{
- // if (ImGui::BeginMenu("Graphics")) {
- // ImGui::Text("ImGui Menu Scale");
- // ImGui::SameLine();
- // ImGui::TextColored({ 0.85f, 0.35f, 0.0f, 1.0f }, "(Experimental)");
- // if (UIWidgets::EnhancementCombobox(CVAR_SETTING("ImGuiScale"), imguiScaleOptions, 1)) {
- // OTRGlobals::Instance->ScaleImGui();
- // }
- // UIWidgets::Tooltip("Changes the scaling of the ImGui menu elements.");
-
- // // Draw LUS settings menu (such as Overlays Text Font)
- // Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings();
-
- // ImGui::EndMenu();
- // }
- // ImGui::EndMenu();
- //}
}
void SohMenuBar::InitElement() {
diff --git a/soh/soh/SohGui/SohMenuSettings.cpp b/soh/soh/SohGui/SohMenuSettings.cpp
index a9103377b..5a186b0ae 100644
--- a/soh/soh/SohGui/SohMenuSettings.cpp
+++ b/soh/soh/SohGui/SohMenuSettings.cpp
@@ -15,6 +15,7 @@ namespace SohGui {
extern std::shared_ptr<SohMenu> mSohMenu;
using namespace UIWidgets;
static std::unordered_map<int32_t, const char*> languages = {{ LANGUAGE_ENG, "English" }, { LANGUAGE_GER, "German" }, { LANGUAGE_FRA, "French" }};
+static std::unordered_map<int32_t, const char*> imguiScaleOptions = {{ 0, "Small" }, { 1, "Normal" }, { 2, "Large" }, { 3, "X-Large" }};
const char* GetGameVersionString(uint32_t index) {
uint32_t gameVersion = ResourceMgr_GetGameVersion(index);
@@ -115,6 +116,15 @@ void SohMenu::AddMenuSettings() {
AddWidget(path, "Disable Idle Camera Re-Centering", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_SETTING("A11yDisableIdleCam"))
.Options(CheckboxOptions().Tooltip("Disables the automatic re-centering of the camera when idle."));
+ AddWidget(path, "EXPERIMENTAL", WIDGET_SEPARATOR_TEXT)
+ .Options(WidgetOptions().Color(Colors::Orange));
+ AddWidget(path, "ImGui Menu Scaling", WIDGET_CVAR_COMBOBOX)
+ .CVar(CVAR_SETTING("ImGuiScale"))
+ .Options(ComboboxOptions().ComboMap(imguiScaleOptions).Tooltip("Changes the scaling of the ImGui menu elements.").DefaultIndex(1)
+ .ComponentAlignment(ComponentAlignment::Right).LabelPosition(LabelPosition::Far))
+ .Callback([](WidgetInfo& info) {
+ OTRGlobals::Instance->ScaleImGui();
+ });
// General - About
path.column = SECTION_COLUMN_2;