diff --git a/src/gui/storyCaptionWidgets.tw b/src/gui/storyCaptionWidgets.tw index 7e20114b35f6e1f0b7f361f1ed75cf47575d0522..9efbfd1e31ea835c7463abcc1c42189f49f49029 100644 --- a/src/gui/storyCaptionWidgets.tw +++ b/src/gui/storyCaptionWidgets.tw @@ -16,10 +16,6 @@ <strong><div id="nextButton"> <<if $nextButton != " ">> <<link "$nextButton">> - <<if _passageSwitchHandler>> - <<run _passageSwitchHandler();>> - <<set _passageSwitchHandler = null>> - <</if>> <<goto $nextLink>> <</link>> @@.cyan;[Space]@@ <</if>> diff --git a/src/interaction/policies/policies.tw b/src/interaction/policies/policies.tw index 630654d3e3e3a405195093e7b792201e8675344d..29c2524ffa83ca9d916068e8aa464c090f294e94 100644 --- a/src/interaction/policies/policies.tw +++ b/src/interaction/policies/policies.tw @@ -7,7 +7,7 @@ </style> <<set $nextButton = "Back">> -<<set _passageSwitchHandler = App.EventHandlers.societyChanged>> +<<set $passageSwitchHandler = App.EventHandlers.societyChanged>> <<if $arcologies[0].FSSupremacistLawME && $PC.race != $arcologies[0].FSSupremacistRace>> <<set $nextLink = "Gameover", $gameover = "Idiot Ball 2 The Dumbassening">> <<elseif $arcologies[0].FSSubjugationistLawME && $PC.race == $arcologies[0].FSSubjugationistRace>> diff --git a/src/uncategorized/options.tw b/src/uncategorized/options.tw index cb985f3f58f57cd7a2856d59783f93b2eb9d530a..739b3ee57c027983fa9bcca34e97de59286a7f6f 100644 --- a/src/uncategorized/options.tw +++ b/src/uncategorized/options.tw @@ -23,7 +23,7 @@ <</if>> <<set $nextButton = "Back", $nextLink = $storedLink, $encyclopedia = "How to Play">> -<<set _passageSwitchHandler = App.EventHandlers.optionsChanged>> +<<set $passageSwitchHandler = App.EventHandlers.optionsChanged>> <<set _options = new App.UI.OptionsGroup()>> <<run _options.addOption("End of week autosaving is currently", "autosave") diff --git a/src/uncategorized/summaryOptions.tw b/src/uncategorized/summaryOptions.tw index 62115362074fc348c5da29870ef50aff65f10fa7..bb269e7d04b462c6a004bc93f6468a106ef0d059 100644 --- a/src/uncategorized/summaryOptions.tw +++ b/src/uncategorized/summaryOptions.tw @@ -9,7 +9,7 @@ <</if>> <</if>> <<set $nextLink = $storedLink>> -<<set _passageSwitchHandler = App.EventHandlers.optionsChanged>> +<<set $passageSwitchHandler = App.EventHandlers.optionsChanged>> <h1>Summary Options</h1> diff --git a/src/zz1-last/setupEventHandlers.js b/src/zz1-last/setupEventHandlers.js index 44cba09f389236f963c15e85054696220dd01ff1..0a6ef4160227ad480de47f3b895c24cc870cd2ba 100644 --- a/src/zz1-last/setupEventHandlers.js +++ b/src/zz1-last/setupEventHandlers.js @@ -2,7 +2,7 @@ Config.saves.onLoad = App.EventHandlers.onLoad; Config.saves.onSave = App.EventHandlers.onSave; -$(document).on(':storyready', function(ev) { +$(document).on(':storyready', function() { App.EventHandlers.storyReady(); }); @@ -15,3 +15,10 @@ $(document).on(':passagestart', function() { get: () => S }); }); + +$(document).on("passageinit", () => { + if (V.passageSwitchHandler) { + V.passageSwitchHandler(); + delete V.passageSwitchHandler; + } +});