From 0e6ca5361e03c4945a7a8a1a3f858dc764cb0a97 Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Wed, 27 Apr 2022 00:36:28 +0200 Subject: [PATCH] Fix L/R buttons color in Kaleido menu (#172) * Fix L/R buttons color in Kaleido menu. I know this is a bug even official game but that definitely a logic bug. That could be considered are a mods. This make both button L and R have the same color on Hover and normal. * Update z_kaleido_scope_PAL.c * Condition to be on Added condition to be on only if toggled on * Cvar registers * bool addition * Added the item in menu * Added bool in bootcommands By default it is on. * Hide and make it forced on by default * Hide menu entry for that fix --- libultraship/libultraship/GameSettings.cpp | 5 +++++ libultraship/libultraship/GameSettings.h | 2 +- libultraship/libultraship/SohImGuiImpl.cpp | 5 +++++ soh/soh/Enhancements/bootcommands.c | 2 +- .../misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c | 16 +++++++++++++--- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 5e02037de..029e2a1a2 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -74,6 +74,10 @@ namespace Game { Settings.enhancements.mm_bunny_hood = stob(Conf[EnhancementSection]["mm_bunny_hood"]); CVar_SetS32("gMMBunnyHood", Settings.enhancements.mm_bunny_hood); + + Settings.enhancements.uniform_lr = stob(Conf[EnhancementSection]["uniform_lr"]); + //CVar_SetS32("gUniformLR", Settings.enhancements.uniform_lr); + CVar_SetS32("gUniformLR", 1); Settings.enhancements.newdrops = stob(Conf[EnhancementSection]["newdrops"]); CVar_SetS32("gNewDrops", Settings.enhancements.newdrops); @@ -264,6 +268,7 @@ namespace Game { Conf[EnhancementSection]["newdrops"] = std::to_string(Settings.enhancements.newdrops); Conf[EnhancementSection]["visualagony"] = std::to_string(Settings.enhancements.visualagony); Conf[EnhancementSection]["mm_bunny_hood"] = std::to_string(Settings.enhancements.mm_bunny_hood); + Conf[EnhancementSection]["uniform_lr"] = std::to_string(Settings.enhancements.uniform_lr); // Controllers diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index c2d2107e0..4f4eecb97 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -29,7 +29,7 @@ struct SoHConfigType { bool newdrops = false; bool visualagony = false; bool mm_bunny_hood = false; - + bool uniform_lr = true; } enhancements; // Controller diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index a2a648bc8..478f51590 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -473,6 +473,11 @@ namespace SohImGui { CVar_SetS32("gMMBunnyHood", Game::Settings.enhancements.mm_bunny_hood); needs_save = true; } + + /*if (ImGui::Checkbox("Fix L&R Pause menu", &Game::Settings.enhancements.uniform_lr)) { + CVar_SetS32("gUniformLR", Game::Settings.enhancements.uniform_lr); + needs_save = true; + }*/ if (ImGui::Checkbox("Visual Stone of Agony", &Game::Settings.enhancements.visualagony)) { CVar_SetS32("gVisualAgony", Game::Settings.enhancements.visualagony); diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index f3ad9aaac..60143e295 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -25,9 +25,9 @@ void BootCommands_Init() CVar_RegisterS32("gDebugEnabled", 0); CVar_RegisterS32("gPauseLiveLink", 0); CVar_RegisterS32("gMinimalUI", 0); + CVar_RegisterS32("gUniformLR", 1); CVar_RegisterS32("gNewDrops", 0); CVar_RegisterS32("gVisualAgony", 0); - } //void BootCommands_ParseBootArgs(char* str) diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 60d3595aa..ac1864412 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1614,14 +1614,24 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); + } else { + if (CVar_GetS32("gUniformLR", 0) != 0) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } } - + gSPDisplayList(POLY_KAL_DISP++, gLButtonIconDL); - - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 220); + + if (CVar_GetS32("gUniformLR", 0) == 0) { //Restore the misplace gDPSetPrimColor + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); + } else { + if (CVar_GetS32("gUniformLR", 0) != 0) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } } gSPDisplayList(POLY_KAL_DISP++, gRButtonIconDL);