From 3758d8bb8d85e1ebb241909154fe0f3598edd18d Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 23 Jul 2022 20:36:46 +0200 Subject: [PATCH] Removed bool declaration --- soh/soh/Enhancements/randomizer/randomizer.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 043ba23b0..8deb4b549 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3717,7 +3717,6 @@ void DrawRandoEditor(bool& open) { } bool disableEditingRandoSettings = CVar_GetS32("gRandoGenerating", 0) || CVar_GetS32("gOnFileSelectNameEntry", 0); - bool disableZeldaRelatedOptions = CVar_GetS32("gRandomizeSkipChildZelda", 0); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableEditingRandoSettings); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * (disableEditingRandoSettings ? 0.5f : 1.0f)); @@ -3968,15 +3967,16 @@ void DrawRandoEditor(bool& open) { // Shuffle Weird Egg // Disabled when Skip Child Zelda is active if (!disableEditingRandoSettings) { - ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableZeldaRelatedOptions); + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, CVar_GetS32("gRandomizeSkipChildZelda", 0)); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, - ImGui::GetStyle().Alpha * (disableZeldaRelatedOptions ? 0.5f : 1.0f)); + ImGui::GetStyle().Alpha * + (CVar_GetS32("gRandomizeSkipChildZelda", 0) ? 0.5f : 1.0f)); } SohImGui::EnhancementCheckbox(Settings::ShuffleWeirdEgg.GetName().c_str(), "gRandomizeShuffleWeirdEgg"); if (!disableEditingRandoSettings) { ImGui::PopStyleVar(); if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && - disableZeldaRelatedOptions) { + CVar_GetS32("gRandomizeSkipChildZelda", 0)) { ImGui::SetTooltip("%s", "This option is disabled because \"Skip Child Zelda\" is enabled"); } @@ -4086,15 +4086,17 @@ void DrawRandoEditor(bool& open) { // Skip child stealth // Disabled when Skip Child Zelda is active if (!disableEditingRandoSettings) { - ImGui::PushItemFlag(ImGuiItemFlags_Disabled, disableZeldaRelatedOptions); + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, CVar_GetS32("gRandomizeSkipChildZelda", 0)); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, - ImGui::GetStyle().Alpha * (disableZeldaRelatedOptions ? 0.5f : 1.0f)); + ImGui::GetStyle().Alpha * + (CVar_GetS32("gRandomizeSkipChildZelda", 0) ? 0.5f : 1.0f)); } SohImGui::EnhancementCheckbox(Settings::SkipChildStealth.GetName().c_str(), "gRandomizeSkipChildStealth"); if (!disableEditingRandoSettings) { ImGui::PopStyleVar(); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && disableZeldaRelatedOptions) { + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + CVar_GetS32("gRandomizeSkipChildZelda", 0)) { ImGui::SetTooltip("%s", "This option is disabled because \"Skip Child Zelda\" is enabled"); } ImGui::PopItemFlag();