Fix: "Developer Tools" button sizes (#1757)

* Small debug buttons fix

* Better fix for buttons
This commit is contained in:
aMannus 2022-10-12 23:35:40 +02:00 committed by GitHub
parent d102506fba
commit 6e88a3706c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1112,12 +1112,7 @@ namespace GameMenuBar {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
#ifdef __WIIU__ if (ImGui::Button(GetWindowButtonText("Cosmetics Editor", CVar_GetS32("gCosmeticsEditorEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
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))
{ {
bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0); bool currentValue = CVar_GetS32("gCosmeticsEditorEnabled", 0);
CVar_SetS32("gCosmeticsEditorEnabled", !currentValue); CVar_SetS32("gCosmeticsEditorEnabled", !currentValue);
@ -1408,12 +1403,7 @@ namespace GameMenuBar {
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0)); ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0,0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f)); ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
#ifdef __WIIU__ if (ImGui::Button(GetWindowButtonText("Stats", CVar_GetS32("gStatsEnabled", 0)).c_str(), ImVec2(-1.0f, 0.0f)))
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))
{ {
bool currentValue = CVar_GetS32("gStatsEnabled", 0); bool currentValue = CVar_GetS32("gStatsEnabled", 0);
CVar_SetS32("gStatsEnabled", !currentValue); 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::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
UIWidgets::Spacer(0); 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); bool currentValue = CVar_GetS32("gConsoleEnabled", 0);
CVar_SetS32("gConsoleEnabled", !currentValue); 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::Tooltip("Enables the console window, allowing you to input commands, type help for some examples");
UIWidgets::Spacer(0); 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); bool currentValue = CVar_GetS32("gSaveEditorEnabled", 0);
CVar_SetS32("gSaveEditorEnabled", !currentValue); CVar_SetS32("gSaveEditorEnabled", !currentValue);
@ -1439,7 +1429,7 @@ namespace GameMenuBar {
SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0)); SohImGui::EnableWindow("Save Editor", CVar_GetS32("gSaveEditorEnabled", 0));
} }
UIWidgets::Spacer(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); bool currentValue = CVar_GetS32("gCollisionViewerEnabled", 0);
CVar_SetS32("gCollisionViewerEnabled", !currentValue); CVar_SetS32("gCollisionViewerEnabled", !currentValue);
@ -1447,7 +1437,7 @@ namespace GameMenuBar {
SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0)); SohImGui::EnableWindow("Collision Viewer", CVar_GetS32("gCollisionViewerEnabled", 0));
} }
UIWidgets::Spacer(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); bool currentValue = CVar_GetS32("gActorViewerEnabled", 0);
CVar_SetS32("gActorViewerEnabled", !currentValue); CVar_SetS32("gActorViewerEnabled", !currentValue);