From 1d7996ce99acc0e83774298793f5cd6aa5c5be38 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Mon, 7 Dec 2020 15:18:05 -0500 Subject: [PATCH] move functions to end --- src/facilities/fsPassage.js | 87 ++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/src/facilities/fsPassage.js b/src/facilities/fsPassage.js index 8367c6a268b..429fffd808c 100644 --- a/src/facilities/fsPassage.js +++ b/src/facilities/fsPassage.js @@ -346,50 +346,6 @@ App.UI.FSPassage = function() { let r; let p; - // TODO: move to wider scope and use in fsDevelopments - function pursuit() { - return App.UI.DOM.makeElement("span", "You are pursuing", "bold"); - } - - /** - * - * @param {FC.FutureSociety} FS - * @param {Array} [itemArray] - */ - function FSIsChosen(FS, itemArray) { - const el = new DocumentFragment(); - const r = []; - - // Abandon - if (FS === "FSRestart" && V.eugenicsFullControl !== 1) { - r.push(`The Societal Elite will not permit you to abandon Eugenics.`); - } else { - r.push( - App.UI.DOM.link( - "Abandon", - () => { - FutureSocieties.remove(FS); - App.UI.reload(); - } - ) - ); - } - - // Decoration - r.push(App.UI.FSChangeDecoration(FS, itemArray)); - - // Assistant - if (V.policies.publicPA === 1) { - if (App.Data.Assistant.appearanceForFS.get(FS).includes(V.assistant.appearance)) { - const {hisA} = getPronouns(assistant.pronouns().main).appendSuffix('A'); - r.push(App.UI.DOM.makeElement("div", `With ${hisA} ${V.assistant.appearance} appearance, ${V.assistant.name} is a good public mascot for this goal.`, "note")); - } - } - - App.Events.addNode(el, r); - return el; - } - /* Race */ p = document.createElement("p"); r = []; @@ -1339,5 +1295,48 @@ App.UI.FSPassage = function() { el.append(p); return el; + + function pursuit() { + return App.UI.DOM.makeElement("span", "You are pursuing", "bold"); + } + + /** + * + * @param {FC.FutureSociety} FS + * @param {Array} [itemArray] + */ + function FSIsChosen(FS, itemArray) { + const el = new DocumentFragment(); + const r = []; + + // Abandon + if (FS === "FSRestart" && V.eugenicsFullControl !== 1) { + r.push(`The Societal Elite will not permit you to abandon Eugenics.`); + } else { + r.push( + App.UI.DOM.link( + "Abandon", + () => { + FutureSocieties.remove(FS); + App.UI.reload(); + } + ) + ); + } + + // Decoration + r.push(App.UI.FSChangeDecoration(FS, itemArray)); + + // Assistant + if (V.policies.publicPA === 1) { + if (App.Data.Assistant.appearanceForFS.get(FS).includes(V.assistant.appearance)) { + const {hisA} = getPronouns(assistant.pronouns().main).appendSuffix('A'); + r.push(App.UI.DOM.makeElement("div", `With ${hisA} ${V.assistant.appearance} appearance, ${V.assistant.name} is a good public mascot for this goal.`, "note")); + } + } + + App.Events.addNode(el, r); + return el; + } } }; -- GitLab