mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-07-03 21:20:31 -04:00
adjust closed forest and starting age settings for edge cases (#2421)
This commit is contained in:
@@ -3168,33 +3168,19 @@ void DrawRandoEditor(bool& open) {
|
||||
|
||||
//Starting Age
|
||||
//Disabled when Forest is set to Closed or under very specific conditions
|
||||
//RANDOTODO: Replace magic number checks with enums
|
||||
bool disableRandoStartingAge = (CVarGetInteger("gRandomizeLogicRules", RO_LOGIC_GLITCHLESS) == RO_LOGIC_GLITCHLESS) &&
|
||||
((CVarGetInteger("gRandomizeForest", RO_FOREST_CLOSED) == RO_FOREST_CLOSED) ||
|
||||
((CVarGetInteger("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) &&
|
||||
(CVarGetInteger("gRandomizeShuffleOcarinas", 0) == 0))); // ocarinas not shuffled
|
||||
|
||||
bool disableRandoStartingAge = CVarGetInteger("gRandomizeForest", RO_FOREST_CLOSED) == RO_FOREST_CLOSED ||
|
||||
((CVarGetInteger("gRandomizeDoorOfTime", RO_DOOROFTIME_CLOSED) == RO_DOOROFTIME_CLOSED) &&
|
||||
(CVarGetInteger("gRandomizeShuffleOcarinas", RO_GENERIC_OFF) == RO_GENERIC_OFF)); // closed door of time with ocarina shuffle off
|
||||
|
||||
static const char* disableRandoStartingAgeText = "This option is disabled due to other options making the game unbeatable.";
|
||||
ImGui::Text(Settings::StartingAge.GetName().c_str());
|
||||
UIWidgets::InsertHelpHoverText(
|
||||
"Choose which age Link will start as.\n\n"
|
||||
"Starting as adult means you start with the Master Sword in your inventory.\n"
|
||||
"The child option is forcefully set if it would conflict with other options."
|
||||
"The child option is forcefully set if it would conflict with other options."
|
||||
);
|
||||
if (disableRandoStartingAge) {
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f);
|
||||
}
|
||||
UIWidgets::EnhancementCombobox("gRandomizeStartingAge", randoStartingAge, RO_AGE_MAX, RO_AGE_CHILD);
|
||||
if (disableRandoStartingAge) {
|
||||
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
|
||||
ImGui::SetTooltip("%s", disableRandoStartingAgeText);
|
||||
}
|
||||
CVarSetInteger("gRandomizeStartingAge", RO_AGE_CHILD);
|
||||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopItemFlag();
|
||||
}
|
||||
|
||||
UIWidgets::EnhancementCombobox("gRandomizeStartingAge", randoStartingAge, RO_AGE_MAX, RO_AGE_CHILD, disableRandoStartingAge, disableRandoStartingAgeText, RO_AGE_CHILD);
|
||||
|
||||
UIWidgets::PaddedSeparator();
|
||||
|
||||
// Gerudo Fortress
|
||||
|
||||
Reference in New Issue
Block a user