diff --git a/src/005-passages/facilitiesPassages.js b/src/005-passages/facilitiesPassages.js index 8aab5295314af0b8075b85e4ef63e69701e276b8..095beed8ac18cfb7f25bce4f2eeba2aa39f89cd5 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 65b69074f53bfb2ab87bbf69a1d20918e4b2a0ee..3fcb4dcf7ecfe50ad2b6b8b347621fa13672a040 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 0000000000000000000000000000000000000000..07383d10a21144d8793b4ea8fb2b4592f11483a9 --- /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; + } +};