From 1ddba14a2507097e63410b47c1ee8a35d1789f13 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 3 Jan 2021 13:24:20 -0500 Subject: [PATCH] Begin, move files --- src/005-passages/facilitiesPassages.js | 9 +++ src/descriptions/officeDescription.js | 2 +- .../penthouse}/managePenthouse.tw | 0 src/facilities/penthouse/penthousePassage.js | 66 +++++++++++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) rename src/{uncategorized => facilities/penthouse}/managePenthouse.tw (100%) create mode 100644 src/facilities/penthouse/penthousePassage.js diff --git a/src/005-passages/facilitiesPassages.js b/src/005-passages/facilitiesPassages.js index 8aab5295314..095beed8ac1 100644 --- a/src/005-passages/facilitiesPassages.js +++ b/src/005-passages/facilitiesPassages.js @@ -77,3 +77,12 @@ new App.DomPassage("Toy Shop", return App.UI.toyShop(); }, ["jump-to-safe", "jump-from-safe"] ); + +new App.DomPassage("Manage Penthouse", + () => { + V.nextButton = "Back"; + V.nextLink = "Manage Penthouse"; + V.encyclopedia = "What the Upgrades Do"; + return App.UI.managePenthouse(); + }, ["jump-to-safe", "jump-from-safe"] +); diff --git a/src/descriptions/officeDescription.js b/src/descriptions/officeDescription.js index 65b69074f53..3fcb4dcf7ec 100644 --- a/src/descriptions/officeDescription.js +++ b/src/descriptions/officeDescription.js @@ -1,5 +1,5 @@ /** - * @param {DocumentFragment} [lastElement] will go on the same line as the last line + * @param {DocumentFragment|string} [lastElement] will go on the same line as the last line * @returns {DocumentFragment} */ App.Desc.officeDescription = function(lastElement) { diff --git a/src/uncategorized/managePenthouse.tw b/src/facilities/penthouse/managePenthouse.tw similarity index 100% rename from src/uncategorized/managePenthouse.tw rename to src/facilities/penthouse/managePenthouse.tw diff --git a/src/facilities/penthouse/penthousePassage.js b/src/facilities/penthouse/penthousePassage.js new file mode 100644 index 00000000000..07383d10a21 --- /dev/null +++ b/src/facilities/penthouse/penthousePassage.js @@ -0,0 +1,66 @@ +/** + * UI for managing Penthouse Refreshes without refreshing the passage. + */ +App.UI.managePenthouse = function(slave, cheat = false) { + const frag = new DocumentFragment(); + frag.append(intro()); + + const container = document.createElement("span"); + container.append(createPage()); + + frag.append(container); + return frag; + + function createPage() { + const el = new DocumentFragment(); + el.append(capacity()); + el.append(facilities()); + el.append(surgery()); + el.append(upgrades()); + return el; + } + + function capacity() { + const el = new DocumentFragment(); + + return el; + } + + function facilities() { + const el = new DocumentFragment(); + + return el; + } + + function surgery() { + const el = new DocumentFragment(); + + return el; + } + + function upgrades() { + const el = new DocumentFragment(); + + return el; + } + function refresh() { + jQuery(container).empty().append(createPage()); + } + + function intro() { + const el = new DocumentFragment(); + if (V.cheatMode) { + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Cheat Edit Arcology", + () => { + V.cheater = 1; + }, + [], + "MOD_Edit Arcology Cheat" + )); + } + App.UI.DOM.appendNewElement("h1", el, "Penthouse"); + App.UI.DOM.appendNewElement("div", el, App.Desc.officeDescription(V.PC.career === "mercenary" ? "You look back at the rifle. It could never hold a zero, and would fail to feed if it wasn't given just the right amount of lubricant. But sometimes, you'd give anything for one more mission with that shitty old rifle." :""), "scene-intro"); + return el; + } +}; -- GitLab