From 6e88a3706ccb23340c95f92417036a4bd5e38d6a Mon Sep 17 00:00:00 2001 From: aMannus Date: Wed, 12 Oct 2022 23:35:40 +0200 Subject: [PATCH] Fix: "Developer Tools" button sizes (#1757) * Small debug buttons fix * Better fix for buttons --- soh/soh/GameMenuBar.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 208a8e58a..df6af83ad 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -1112,12 +1112,7 @@ namespace GameMenuBar { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0)); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); - #ifdef __WIIU__ - static ImVec2 buttonSize(200.0f * 2.0f, 0.0f); - #else - static ImVec2 buttonSize(200.0f, 0.0f); - #endif - if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0); CVar_SetS32("gCosmeticsEditorEnabled", !currentValue); @@ -1408,12 +1403,7 @@ namespace GameMenuBar { ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0)); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); - #ifdef __WIIU__ - static ImVec2 buttonSize(160.0f * 2.0f, 0.0f); - #else - static ImVec2 buttonSize(160.0f, 0.0f); - #endif - if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gStatsEnabled", 0); CVar_SetS32("gStatsEnabled", !currentValue); @@ -1422,7 +1412,7 @@ namespace GameMenuBar { } UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Console", CVar_GetS32("gConsoleEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gConsoleEnabled", 0); CVar_SetS32("gConsoleEnabled", !currentValue); @@ -1431,7 +1421,7 @@ namespace GameMenuBar { } UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type help for some examples"); UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0); CVar_SetS32("gSaveEditorEnabled", !currentValue); @@ -1439,7 +1429,7 @@ namespace GameMenuBar { SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)); } UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0); CVar_SetS32("gCollisionViewerEnabled", !currentValue); @@ -1447,7 +1437,7 @@ namespace GameMenuBar { SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)); } UIWidgets::Spacer(0); - if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), buttonSize)) + if (ImGui::Button(GetWindowButtonText("Actor Viewer", CVar_GetS32("gActorViewerEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f))) { bool currentValue = CVar_GetS32("gActorViewerEnabled", 0); CVar_SetS32("gActorViewerEnabled", !currentValue);