Cal's requests.

This commit is contained in:
Malkierian 2025-04-10 19:49:47 -07:00
commit 97d454118a
8 changed files with 37 additions and 31 deletions

View file

@ -2376,10 +2376,12 @@ void CosmeticsEditorWindow::DrawElement() {
.Step(0.01f)
.Size(ImVec2(300.0f, 0.0f))
.Color(THEME_COLOR));
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
UIWidgets::CVarCheckbox("Randomize All on New Scene", CVAR_COSMETIC("RandomizeAllOnNewScene"),
UIWidgets::CheckboxOptions()
.Color(THEME_COLOR)
.Tooltip("Enables randomizing all unlocked cosmetics when you enter a new scene."));
ImGui::EndDisabled();
UIWidgets::CVarCheckbox(
"Advanced Mode", CVAR_COSMETIC("AdvancedMode"),
UIWidgets::CheckboxOptions()
@ -2408,9 +2410,12 @@ void CosmeticsEditorWindow::DrawElement() {
}
}
}
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
if (UIWidgets::Button("Randomize All", UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
CosmeticsEditor_RandomizeAll();
}
ImGui::EndDisabled();
ImGui::SameLine();
if (UIWidgets::Button("Reset All", UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
CVarClearBlock("gCosmetics");
@ -2432,6 +2437,7 @@ void CosmeticsEditorWindow::DrawElement() {
}
}
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
if (UIWidgets::Button("Rainbow All", UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
if (!CVarGetInteger(cosmeticOption.lockedCvar, 0) &&
@ -2441,6 +2447,8 @@ void CosmeticsEditorWindow::DrawElement() {
}
}
}
ImGui::EndDisabled();
ImGui::SameLine();
if (UIWidgets::Button("Un-Rainbow All", UIWidgets::ButtonOptions().Size(ImVec2(250.0f, 0.0f)).Color(THEME_COLOR))) {
for (auto& [id, cosmeticOption] : cosmeticOptions) {
@ -2470,6 +2478,7 @@ void CosmeticsEditorWindow::DrawElement() {
if (ImGui::BeginTabItem("Keys")) {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
UIWidgets::Separator(true, true, 2.0f, 2.0f);
if (UIWidgets::Button("Give all keys dungeon-specific colors",
@ -2483,6 +2492,7 @@ void CosmeticsEditorWindow::DrawElement() {
DrawCosmeticGroup(COSMETICS_GROUP_SMALL_KEYS);
DrawCosmeticGroup(COSMETICS_GROUP_BOSS_KEYS);
ImGui::EndDisabled();
ImGui::EndTabItem();
}

View file

@ -368,7 +368,9 @@ void OptionGroup::Disable() {
bool OptionGroup::RenderImGui() const { // NOLINT(*-no-recursion)
ImGuiWindow* window = ImGui::GetCurrentWindow();
bool changed = false;
ImGui::BeginDisabled(mDisabled);
ImGui::BeginDisabled(mDisabled || CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) ||
CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) ||
CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0));
if (mContainerType == WidgetContainerType::TABLE) {
if (ImGui::BeginTable(mName.c_str(), static_cast<int>(mSubGroups.size()),
ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {

View file

@ -3690,6 +3690,7 @@ void RandomizerSettingsWindow::DrawElement() {
locationsTabOpen = false;
tricksTabOpen = false;
}
ImGui::EndDisabled();
UIWidgets::Spacer(0);
UIWidgets::CVarCheckbox("Manual seed entry", CVAR_RANDOMIZER_SETTING("ManualSeedEntry"),
@ -3725,9 +3726,7 @@ void RandomizerSettingsWindow::DrawElement() {
}
UIWidgets::Spacer(0);
ImGui::BeginDisabled((CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0) &&
gSaveContext.gameMode != GAMEMODE_FILE_SELECT) ||
GameInteractor::IsSaveLoaded());
ImGui::BeginDisabled((gSaveContext.gameMode != GAMEMODE_FILE_SELECT) || GameInteractor::IsSaveLoaded());
if (UIWidgets::Button("Generate Randomizer",
UIWidgets::ButtonOptions().Size(ImVec2(250.f, 0.f)).Color(THEME_COLOR))) {
ctx->SetSpoilerLoaded(false);
@ -3746,7 +3745,6 @@ void RandomizerSettingsWindow::DrawElement() {
// ImGui::Text("Settings File: %s", presetfilepath.c_str());
UIWidgets::Separator(true, true, 0.f, 0.f);
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
ImGuiWindow* window = ImGui::GetCurrentWindow();
static ImVec2 cellPadding(8.0f, 8.0f);
@ -3762,8 +3760,6 @@ void RandomizerSettingsWindow::DrawElement() {
ImGui::EndTabItem();
}
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
if (ImGui::BeginTabItem("Items")) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
@ -3775,23 +3771,23 @@ void RandomizerSettingsWindow::DrawElement() {
ImGui::PopStyleVar(1);
ImGui::EndTabItem();
}
ImGui::EndDisabled();
if (ImGui::BeginTabItem("Gameplay")) {
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
if (ImGui::BeginTabItem("Gameplay")) {
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
if (mSettings->GetOptionGroup(RSG_GAMEPLAY_IMGUI_TABLE).RenderImGui()) {
mNeedsUpdate = true;
}
ImGui::EndDisabled();
ImGui::PopStyleVar(1);
ImGui::EndTabItem();
}
ImGui::EndDisabled();
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
if (ImGui::BeginTabItem("Locations")) {
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings ||
CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
if (!locationsTabOpen) {
locationsTabOpen = true;
@ -3924,10 +3920,10 @@ void RandomizerSettingsWindow::DrawElement() {
}
ImGui::PopStyleVar(1);
ImGui::EndTabItem();
ImGui::EndDisabled();
} else {
locationsTabOpen = false;
}
ImGui::EndDisabled();
if (ImGui::BeginTabItem("Tricks/Glitches")) {
if (!tricksTabOpen) {
@ -3975,7 +3971,8 @@ void RandomizerSettingsWindow::DrawElement() {
ImGui::EndTable();
}
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0) || disableEditingRandoSettings ||
CVarGetInteger(CVAR_RANDOMIZER_SETTING("LogicRules"), RO_LOGIC_GLITCHLESS) ==
RO_LOGIC_VANILLA);
// Tricks
@ -4354,9 +4351,6 @@ void RandomizerSettingsWindow::DrawElement() {
ImGui::EndTabBar();
}
UIWidgets::PopStyleTabs();
ImGui::EndDisabled();
ImGui::EndDisabled();
}
void RandomizerSettingsWindow::UpdateElement() {

View file

@ -2075,11 +2075,13 @@ void CheckTrackerSettingsWindow::DrawElement() {
.DefaultIndex(TRACKER_COMBO_BUTTON_L));
}
}
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
UIWidgets::CVarCheckbox("Vanilla/MQ Dungeon Spoilers", CVAR_TRACKER_CHECK("MQSpoilers"),
UIWidgets::CheckboxOptions()
.Tooltip("If enabled, Vanilla/MQ dungeons will show on the tracker immediately. "
"Otherwise, Vanilla/MQ dungeon locations must be unlocked.")
.Color(THEME_COLOR));
ImGui::EndDisabled();
if (UIWidgets::CVarCheckbox(
"Hide unshuffled shop item checks", CVAR_TRACKER_CHECK("HideUnshuffledShopChecks"),
UIWidgets::CheckboxOptions()
@ -2100,6 +2102,7 @@ void CheckTrackerSettingsWindow::DrawElement() {
UIWidgets::CheckboxOptions()
.Tooltip("If enabled, will show a check's logic when hovering over it.")
.Color(THEME_COLOR));
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
if (UIWidgets::CVarCheckbox("Enable Available Checks", CVAR_TRACKER_CHECK("EnableAvailableChecks"),
UIWidgets::CheckboxOptions()
.Tooltip("If enabled, will show the checks that are available to be collected "
@ -2108,6 +2111,7 @@ void CheckTrackerSettingsWindow::DrawElement() {
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
RecalculateAvailableChecks();
}
ImGui::EndDisabled();
// Filtering settings
UIWidgets::PaddedSeparator();

View file

@ -690,6 +690,7 @@ void EntranceTrackerSettingsWindow::DrawElement() {
UIWidgets::CheckboxOptions()
.Tooltip("Automatically scroll to the first available entrance in the current scene")
.Color(THEME_COLOR));
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
UIWidgets::CVarCheckbox("Highlight previous", CVAR_TRACKER_ENTRANCE("HighlightPrevious"),
UIWidgets::CheckboxOptions()
.Tooltip("Highlight the previous entrance that Link came from")
@ -698,6 +699,7 @@ void EntranceTrackerSettingsWindow::DrawElement() {
UIWidgets::CheckboxOptions()
.Tooltip("Highlight available entrances in the current scene")
.Color(THEME_COLOR));
ImGui::EndDisabled();
UIWidgets::CVarCheckbox("Hide undiscovered", CVAR_TRACKER_ENTRANCE("CollapseUndiscovered"),
UIWidgets::CheckboxOptions()
.Tooltip("Collapse undiscovered entrances towards the bottom of each group")
@ -724,6 +726,7 @@ void EntranceTrackerSettingsWindow::DrawElement() {
UIWidgets::RadioButtonsOptions().Color(THEME_COLOR).Tooltip("Group entrances by their entrance type"));
ImGui::Text("Spoiler Reveal");
ImGui::BeginDisabled(CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
UIWidgets::CVarCheckbox(
"Show Source", CVAR_TRACKER_ENTRANCE("ShowFrom"),
UIWidgets::CheckboxOptions().Tooltip("Reveal the sourcefor undiscovered entrances").Color(THEME_COLOR));
@ -731,7 +734,7 @@ void EntranceTrackerSettingsWindow::DrawElement() {
UIWidgets::CheckboxOptions()
.Tooltip("Reveal the destination for undiscovered entrances")
.Color(THEME_COLOR));
ImGui::EndDisabled();
ImGui::EndTable();
}

View file

@ -222,7 +222,6 @@ void SohMenu::AddMenuEnhancements() {
.Options(CheckboxOptions().Tooltip("Disable Random Camera Wiggle at Low Health."));
AddWidget(path, "Better Owl", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("BetterOwl"))
.RaceDisable(false)
.Options(CheckboxOptions().Tooltip(
"The default response to Kaepora Gaebora is always that you understood what he said."));

View file

@ -31,7 +31,6 @@ void SohMenu::AddMenuNetwork() {
"page to your clipboard.",
WIDGET_TEXT);
AddWidget(path, ICON_FA_CLIPBOARD "##Sail", WIDGET_BUTTON)
.RaceDisable(false)
.Callback([](WidgetInfo& info) {
ImGui::SetClipboardText("https://github.com/HarbourMasters/sail");
Notification::Emit({
@ -39,8 +38,8 @@ void SohMenu::AddMenuNetwork() {
});
})
.Options(ButtonOptions().Tooltip("https://github.com/HarbourMasters/sail"));
AddWidget(path, "Host & Port", WIDGET_CUSTOM).RaceDisable(false).CustomFunction([](WidgetInfo& info) {
ImGui::BeginDisabled(Sail::Instance->isEnabled);
AddWidget(path, "Host & Port", WIDGET_CUSTOM).CustomFunction([](WidgetInfo& info) {
ImGui::BeginDisabled(Sail::Instance->isEnabled || CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
ImGui::Text("%s", info.name.c_str());
CVarInputString("##HostSail", CVAR_REMOTE_SAIL("Host"),
InputOptions()
@ -62,7 +61,6 @@ void SohMenu::AddMenuNetwork() {
ImGui::EndDisabled();
});
AddWidget(path, "Enable##Sail", WIDGET_BUTTON)
.RaceDisable(false)
.PreFunc([](WidgetInfo& info) {
std::string host = CVarGetString(CVAR_REMOTE_SAIL("Host"), "127.0.0.1");
uint16_t port = CVarGetInteger(CVAR_REMOTE_SAIL("Port"), 43384);
@ -105,7 +103,6 @@ void SohMenu::AddMenuNetwork() {
"website to your clipboard.",
WIDGET_TEXT);
AddWidget(path, ICON_FA_CLIPBOARD "##CrowdControl", WIDGET_BUTTON)
.RaceDisable(false)
.Callback([](WidgetInfo& info) {
ImGui::SetClipboardText("https://crowdcontrol.live");
Notification::Emit({
@ -113,8 +110,8 @@ void SohMenu::AddMenuNetwork() {
});
})
.Options(ButtonOptions().Tooltip("https://crowdcontrol.live"));
AddWidget(path, "Host & Port", WIDGET_CUSTOM).RaceDisable(false).CustomFunction([](WidgetInfo& info) {
ImGui::BeginDisabled(CrowdControl::Instance->isEnabled);
AddWidget(path, "Host & Port", WIDGET_CUSTOM).CustomFunction([](WidgetInfo& info) {
ImGui::BeginDisabled(CrowdControl::Instance->isEnabled || CVarGetInteger(CVAR_SETTING("DisableChanges"), 0));
ImGui::Text("%s", info.name.c_str());
CVarInputString("##HostCrowdControl", CVAR_REMOTE_CROWD_CONTROL("Host"),
InputOptions()
@ -136,7 +133,6 @@ void SohMenu::AddMenuNetwork() {
ImGui::EndDisabled();
});
AddWidget(path, "Enable##CrowdControl", WIDGET_BUTTON)
.RaceDisable(false)
.PreFunc([](WidgetInfo& info) {
std::string host = CVarGetString(CVAR_REMOTE_CROWD_CONTROL("Host"), "127.0.0.1");
uint16_t port = CVarGetInteger(CVAR_REMOTE_CROWD_CONTROL("Port"), 43384);

View file

@ -35,7 +35,6 @@ void SohMenu::AddMenuRandomizer() {
.DefaultValue(true));
AddWidget(path, "Use Custom Key Models", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("CustomKeyModels"))
.RaceDisable(false)
.Options(
CheckboxOptions()
.Tooltip("Use Custom graphics for Dungeon Keys, Big and Small, so that they can be easily told apart.")
@ -80,7 +79,6 @@ void SohMenu::AddMenuRandomizer() {
"This might make boss souls more distinguishable from a distance, and can help with performance."));
AddWidget(path, "Skip Get Item Animations", WIDGET_CVAR_COMBOBOX)
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"))
.RaceDisable(false)
.Options(ComboboxOptions().ComboMap(skipGetItemAnimationOptions).DefaultIndex(SGIA_JUNK));
AddWidget(path, "Item Scale: %.2f", WIDGET_CVAR_SLIDER_FLOAT)
.CVar(CVAR_RANDOMIZER_ENHANCEMENT("TimeSavers.SkipGetItemAnimationScale"))