diff --git a/soh/soh/Enhancements/randomizer/option.cpp b/soh/soh/Enhancements/randomizer/option.cpp index a7b4340c9..3cbc76b31 100644 --- a/soh/soh/Enhancements/randomizer/option.cpp +++ b/soh/soh/Enhancements/randomizer/option.cpp @@ -355,9 +355,18 @@ const std::string& OptionGroup::GetDescription() const { return mDescription; } +void OptionGroup::Enable() { + mDisabled = false; +} + +void OptionGroup::Disable() { + mDisabled = true; +} + bool OptionGroup::RenderImGui() const { // NOLINT(*-no-recursion) ImGuiWindow* window = ImGui::GetCurrentWindow(); bool changed = false; + ImGui::BeginDisabled(mDisabled); if (mContainerType == WidgetContainerType::TABLE) { if (ImGui::BeginTable(mName.c_str(), static_cast(mSubGroups.size()), ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) { for (const auto column : mSubGroups) { @@ -424,6 +433,7 @@ bool OptionGroup::RenderImGui() const { // NOLINT(*-no-recursion) if (mContainerType == WidgetContainerType::TABLE) { ImGui::EndTable(); } + ImGui::EndDisabled(); return changed; } } // namespace Rando \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/option.h b/soh/soh/Enhancements/randomizer/option.h index 8e0fd0713..ef0c0a2bb 100644 --- a/soh/soh/Enhancements/randomizer/option.h +++ b/soh/soh/Enhancements/randomizer/option.h @@ -462,6 +462,8 @@ class OptionGroup { * @brief Renders all of the options contained within this `OptionGroup` in the ImGui menu. */ bool RenderImGui() const; + void Disable(); + void Enable(); private: std::string mName; @@ -472,5 +474,6 @@ class OptionGroup { OptionGroupType mContainsType = OptionGroupType::DEFAULT; WidgetContainerType mContainerType = WidgetContainerType::BASIC; std::string mDescription; + bool mDisabled = false; }; } // namespace Rando \ No newline at end of file diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index ea6ad2d23..118f86709 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -1589,6 +1589,48 @@ void Settings::UpdateOptionProperties() { } else { mOptions[RSK_LINKS_POCKET].Enable(); } + + if (CVarGetInteger("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_VANILLA) { + mOptionGroups[RSG_AREA_ACCESS_IMGUI].Disable(); + mOptions[RSK_STARTING_AGE].Disable(""); + mOptions[RSK_GERUDO_FORTRESS].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE].Disable(""); + mOptions[RSK_BRIDGE_OPTIONS].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Disable(""); + mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Disable(""); + mOptions[RSK_GANONS_TRIALS].Disable(""); + mOptions[RSK_TRIAL_COUNT].Disable(""); + mOptions[RSK_TRIFORCE_HUNT].Disable(""); + mOptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL].Disable(""); + mOptions[RSK_TRIFORCE_HUNT_PIECES_REQUIRED].Disable(""); + mOptionGroups[RSG_ITEMS_IMGUI_TABLE].Disable(); + mOptionGroups[RSG_GAMEPLAY_IMGUI_TABLE].Disable(); + mOptions[RSK_LINKS_POCKET].Disable(""); + mOptions[RSK_STARTING_OCARINA].Disable(""); + } else { + mOptionGroups[RSG_AREA_ACCESS_IMGUI].Enable(); + mOptions[RSK_STARTING_AGE].Enable(); + mOptions[RSK_GERUDO_FORTRESS].Enable(); + mOptions[RSK_RAINBOW_BRIDGE].Enable(); + mOptions[RSK_BRIDGE_OPTIONS].Enable(); + mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT].Enable(); + mOptions[RSK_RAINBOW_BRIDGE_MEDALLION_COUNT].Enable(); + mOptions[RSK_RAINBOW_BRIDGE_REWARD_COUNT].Enable(); + mOptions[RSK_RAINBOW_BRIDGE_DUNGEON_COUNT].Enable(); + mOptions[RSK_RAINBOW_BRIDGE_TOKEN_COUNT].Enable(); + mOptions[RSK_GANONS_TRIALS].Enable(); + mOptions[RSK_TRIAL_COUNT].Enable(); + mOptions[RSK_TRIFORCE_HUNT].Enable(); + mOptions[RSK_TRIFORCE_HUNT_PIECES_TOTAL].Enable(); + mOptions[RSK_TRIFORCE_HUNT_PIECES_REQUIRED].Enable(); + mOptionGroups[RSG_ITEMS_IMGUI_TABLE].Enable(); + mOptionGroups[RSG_GAMEPLAY_IMGUI_TABLE].Enable(); + mOptions[RSK_LINKS_POCKET].Enable(); + mOptions[RSK_STARTING_OCARINA].Enable(); + } } void Settings::FinalizeSettings(const std::set& excludedLocations, const std::set& enabledTricks) {