From 45873ba71de9e80f2c16e914d9e4341beb9381b1 Mon Sep 17 00:00:00 2001 From: Sarge-117 Date: Tue, 23 Aug 2022 17:16:19 -0700 Subject: [PATCH] Add CVar + Cvar check Defaults to "1" --- libultraship/libultraship/ImGuiImpl.cpp | 6 ++++++ soh/soh/OTRGlobals.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index ac7ab9d73..311b559a2 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -452,6 +452,7 @@ namespace SohImGui { io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; io->Fonts->AddFontDefault(); statsWindowOpen = CVar_GetS32("gStatsEnabled", 0); + CVar_RegisterS32("gRandoRelevantNavi", 1); #ifdef __SWITCH__ Ship::Switch::SetupFont(io->Fonts); #endif @@ -1912,6 +1913,11 @@ namespace SohImGui { "(medallions/stones/songs). Note that these fanfares\n" "are longer than usual." ); + EnhancementCheckbox("Rando-Relevant Navi Hints", "gRandoRelevantNavi"); + Tooltip( + "Replace Navi's overworld quest hints with rando-\n" + "related gameplay hints.\n" + ); ImGui::EndMenu(); } diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index b8b77d336..2b3024c6c 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1546,7 +1546,7 @@ extern "C" int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx) { } else if (textId == TEXT_SCRUB_POH || textId == TEXT_SCRUB_STICK_UPGRADE || textId == TEXT_SCRUB_NUT_UPGRADE) { messageEntry = Randomizer_GetScrubMessage(textId); // In rando, replace Navi's general overworld hints with rando-related gameplay tips - } else if (textId >= 0x0140 && textId <= 0x015F) { + } else if (CVar_GetS32("gRandoRelevantNavi", 1) && textId >= 0x0140 && textId <= 0x015F) { messageEntry = Randomizer_GetNaviMessage(); } }