Add condition to disabling Generate Randomizer button if file is loaded to prevent rando context confusion. (#4487)

This commit is contained in:
Malkierian 2024-10-27 14:40:30 -07:00 committed by GitHub
parent 438a8bff79
commit e5f4c091f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1393,7 +1393,8 @@ void RandomizerSettingsWindow::DrawElement() {
}
UIWidgets::Spacer(0);
ImGui::BeginDisabled(CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0) && gSaveContext.gameMode != GAMEMODE_FILE_SELECT);
ImGui::BeginDisabled((CVarGetInteger(CVAR_RANDOMIZER_SETTING("DontGenerateSpoiler"), 0) && gSaveContext.gameMode != GAMEMODE_FILE_SELECT) ||
GameInteractor::IsSaveLoaded());
if (ImGui::Button("Generate Randomizer")) {
ctx->SetSpoilerLoaded(false);
GenerateRandomizer(CVarGetInteger(CVAR_RANDOMIZER_SETTING("ManualSeedEntry"), 0) ? seedString : "");