From 95b7e9d02fff88172e9546896b231ec66d06d036 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@gmail.com> Date: Wed, 9 Jun 2021 13:07:30 +0200 Subject: [PATCH] Allow disabling of endweek save warning --- js/003-data/gameVariableData.js | 1 + src/gui/options/options.js | 3 +++ src/js/eventHandlers.js | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 4108a787f76..e21857e5e33 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -97,6 +97,7 @@ App.Data.defaultGameStateVariables = { inbreeding: 1, lastBDayEvent: -1, lineSeparations: 1, + endweekSaveWarning: 1, limitFamilies: 0, makeDicks: 0, modRequestsAllowed: 1, diff --git a/src/gui/options/options.js b/src/gui/options/options.js index 78d0300aa51..edf361c57cb 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -866,6 +866,9 @@ App.Intro.display = function(isIntro) { options.addOption("Line separations are", "lineSeparations") .addValue("Shown", 1).on().addValue("Hidden", 0).off(); + options.addOption("Warning on end week saving", "endweekSaveWarning") + .addValue("Shown", 1).on().addValue("Hidden", 0).off(); + el.append(options.render()); r = []; diff --git a/src/js/eventHandlers.js b/src/js/eventHandlers.js index 469ee3dae9f..abd8f9360ea 100644 --- a/src/js/eventHandlers.js +++ b/src/js/eventHandlers.js @@ -22,7 +22,7 @@ App.EventHandlers = function() { * @param {TwineSugarCube.SaveObject} save */ function onSave(save) { - if (V.endweekFlag) { + if (V.endweekFlag && V.endweekSaveWarning) { $(document).one(':dialogclosed', () => { Dialog.setup("Saving during End Week"); Dialog.append("<p>Saves created during End Week should <span class='warning bold'>ONLY</span> be loaded in the <span class='bold'>SAME</span> game version.</p><p>Please save on <span class='bold'>Main</span> or <span class='bold'>Options</span> if you plan on upgrading your game.</p>"); -- GitLab