Skip to content

Commit

Permalink
Merge pull request Roman971#28 from dotzo/no-logic-warning-new
Browse files Browse the repository at this point in the history
Make the warning a 1-time global
  • Loading branch information
fenhl authored Jun 24, 2024
2 parents 0cdb64c + 42e56dc commit f53b861
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions GUI/src/app/pages/generator/generator.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class GeneratorComponent implements OnInit {
return filteredTabList;
}

generateSeed(fromPatchFile: boolean = false, webRaceSeed: boolean = false, goalHintsConfirmed: boolean = false, noLogicConfirmed: boolean = false) {
generateSeed(fromPatchFile: boolean = false, webRaceSeed: boolean = false, goalHintsConfirmed: boolean = false) {

this.generateSeedButtonEnabled = false;
this.seedString = this.seedString.trim().replace(/[^a-zA-Z0-9_-]/g, '');
Expand Down Expand Up @@ -196,13 +196,15 @@ export class GeneratorComponent implements OnInit {
return;
}

if (!noLogicConfirmed && this.global.generator_settingsMap["logic_rules"] === "none") {
let noLogicConfirmed = localStorage.getItem("noLogicConfirmed")
if ((!noLogicConfirmed || noLogicConfirmed == "false") && this.global.generator_settingsMap["logic_rules"] === "none") {
this.dialogService.open(ConfirmationWindowComponent, {
autoFocus: true, closeOnBackdropClick: false, closeOnEsc: false, hasBackdrop: true, hasScroll: false, context: { dialogHeader: "No Logic Warning", dialogMessage: noLogicErrorText }
}).onClose.subscribe(confirmed => {
//User acknowledged possible unbeatability of no logic seeds
if (confirmed) {
this.generateSeed(fromPatchFile, webRaceSeed, goalHintsConfirmed, true);
localStorage.setItem("noLogicConfirmed", JSON.stringify(true))
this.generateSeed(fromPatchFile, webRaceSeed, goalHintsConfirmed);
}
});

Expand Down

0 comments on commit f53b861

Please sign in to comment.