Apply RandoGenerating lockout to rando preset Apply button.

This commit is contained in:
Malkierian 2025-05-21 12:04:26 -07:00
commit 4987dd7fd0
2 changed files with 6 additions and 4 deletions

View file

@ -146,7 +146,9 @@ void DrawPresetSelector(std::vector<PresetSection> includeSections, std::string
// UIWidgets::Tooltip(comboboxTooltip.c_str());
UIWidgets::PushStyleButton(THEME_COLOR);
if (ImGui::Button(("Apply Preset##" + selectorCvar).c_str())) {
if (UIWidgets::Button(
("Apply Preset##" + selectorCvar).c_str(),
UIWidgets::ButtonOptions({ { .disabled = disabled } }).Color(THEME_COLOR).Size(UIWidgets::Sizes::Inline))) {
applyPreset(currentIndex, includeSections);
}
UIWidgets::PopStyleButton();

View file

@ -3653,10 +3653,10 @@ void RandomizerSettingsWindow::DrawElement() {
generated = 0;
randoThread.join();
}
bool disableEditingRandoSettings =
CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0) || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
bool generating = CVarGetInteger(CVAR_GENERAL("RandoGenerating"), 0);
bool disableEditingRandoSettings = generating || CVarGetInteger(CVAR_GENERAL("OnFileSelectNameEntry"), 0);
DrawPresetSelector({ PRESET_SECTION_RANDOMIZER }, "Randomizer", disableEditingRandoSettings);
DrawPresetSelector({ PRESET_SECTION_RANDOMIZER }, "Randomizer", generating);
// UIWidgets::Spacer(0);
UIWidgets::CVarCheckbox("Manual seed entry", CVAR_RANDOMIZER_SETTING("ManualSeedEntry"),