Skip to content

Commit 94782e0

Browse files
committed
Don't ask for restart on menu exit once declined
1 parent 03d06b4 commit 94782e0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
- Decrease manual wait time before close button is active
1515
- Remove 'Please, read it' manual popup
16+
- Don't ask for restart on menu exit once declined
1617

1718
### Fixed
1819

src/gui/menu.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ declare global {
2929
ENTRY_UNFOCUSED,
3030
ENTRY_UPDATE_COLOR,
3131
}
32+
33+
var onceDeclinedRestartAfterMenuExit: boolean | undefined
34+
3235
interface Menu extends sc.ListInfoMenu, sc.Model {
3336
list: MenuList
3437
inputField: modmanager.gui.InputField
@@ -514,6 +517,7 @@ modmanager.gui.Menu = (sc.ListInfoMenu ?? sc.SortableListMenu).extend({
514517
sc.menu.buttonInteract.removeGlobalButton(this.changelogButton)
515518

516519
if (
520+
!modmanager.gui.onceDeclinedRestartAfterMenuExit &&
517521
sc.menu.menuStack.last() != sc.MENU_SUBMENU.MOD_OPTIONS &&
518522
(LocalMods.getAll().some(mod => mod.awaitingRestart) ||
519523
Object.values(ModDB.databases).some(
@@ -522,6 +526,7 @@ modmanager.gui.Menu = (sc.ListInfoMenu ?? sc.SortableListMenu).extend({
522526
) {
523527
ModInstallDialogs.showYesNoDialog(Lang.modStatesChanged, sc.DIALOG_INFO_ICON.QUESTION).then(index => {
524528
if (index == 0) ModInstaller.restartGame()
529+
else modmanager.gui.onceDeclinedRestartAfterMenuExit = true
525530
})
526531
}
527532
},

0 commit comments

Comments
 (0)