diff --git a/src/004-base/facilityFramework.js b/src/004-base/facilityFramework.js index 4dcd80f86d1e889daa7e50e48064d03f854e4d1c..9546dec278afb8aa64c95d0306ff990dc3fd7d79 100644 --- a/src/004-base/facilityFramework.js +++ b/src/004-base/facilityFramework.js @@ -33,14 +33,8 @@ App.Facilities.Facility = class { () => this._expand(expandArgs), () => this._makeUpgrades(), () => this._makeRules(), + () => this._makeCustomNodes(), () => this._menials(), - ); - - if (this.customNodes.length > 0) { - this.customNodes.forEach(node => this._addSections(() => node)); - } - - this._addSections( () => this._stats(), () => this._slaves(), () => this._rename(), @@ -257,6 +251,22 @@ App.Facilities.Facility = class { return div; } + /** + * Creates any custom nodes and adds them to the facility. + * + * @private + * @returns {HTMLDivElement} + */ + _makeCustomNodes() { + const div = document.createElement("div"); + + if (this.customNodes.length > 0) { + this.customNodes.forEach(node => div.append(node)); + } + + return div; + } + /** * Allows menial slaves to be bought, sold, and assigned to the facility. * diff --git a/src/facilities/farmyard/farmyard.js b/src/facilities/farmyard/farmyard.js index 19d51ee2a3230e95299420252e3fbd8ed9afe9a8..76b1fe374bac1b065fb1fa1f527be0593f7d149b 100644 --- a/src/facilities/farmyard/farmyard.js +++ b/src/facilities/farmyard/farmyard.js @@ -434,8 +434,8 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.farmyardKennels = 1; V.PC.skill.engineering += .1; - this.refresh(); // FIXME: this isn't working for some reason - }, [], passage(), `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic canines.`), ['indent']); + this.refresh(); + }, [], '', `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic canines.`), ['indent']); } else if (V.farmyardKennels === 1) { div.append(App.UI.DOM.passageLink("Kennels", "Farmyard Animals"), ` have been built in one corner of ${V.farmyardName}, and are currently ${CL < 1 ? `empty` : `occupied by ${dogs}`}.`); @@ -446,7 +446,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.PC.skill.engineering += .1; this.refresh(); - }, [], passage(), `Costs ${cashFormat(cost * 2)} will incur additional upkeep costs, and unlocks exotic canines.`), ['indent']); + }, [], '', `Costs ${cashFormat(cost * 2)} will incur additional upkeep costs, and unlocks exotic canines.`), ['indent']); } else { App.UI.DOM.appendNewElement("div", div, App.UI.DOM.disabledLink("Upgrade kennels", [`You must be more reputable to be able to house exotic canines.`]), @@ -480,7 +480,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.PC.skill.engineering += .1; this.refresh(); - }, [], passage(), `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic hooved animals.`), ['indent']); + }, [], '', `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic hooved animals.`), ['indent']); } else if (V.farmyardStables === 1) { div.append(App.UI.DOM.passageLink("Stables", "Farmyard Animals"), ` have been built in one corner of ${V.farmyardName}, and are currently ${HL < 1 ? `empty` : `occupied by ${hooved}`}.`); @@ -491,7 +491,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.PC.skill.engineering += .1; this.refresh(); - }, [], passage(), `Costs ${cashFormat(cost * 2)}, will incur additional upkeep costs, and unlocks exotic hooved animals.`), ['indent']); + }, [], '', `Costs ${cashFormat(cost * 2)}, will incur additional upkeep costs, and unlocks exotic hooved animals.`), ['indent']); } else { App.UI.DOM.appendNewElement("div", div, App.UI.DOM.disabledLink("Upgrade stables", [`You must be more reputable to be able to house exotic hooved animals.`]), @@ -535,7 +535,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.PC.skill.engineering += .1; this.refresh(); - }, [], passage(), `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic felines.`), ['indent']); + }, [], '', `Costs ${cashFormat(cost)}, will incur upkeep costs, and unlocks domestic felines.`), ['indent']); } else if (V.farmyardCages === 1) { div.append(App.UI.DOM.passageLink("Cages", "Farmyard Animals"), ` have been built in one corner of ${V.farmyardName}, and are currently ${FL < 1 ? `empty` : `occupied by ${cats}`}.`); @@ -546,7 +546,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { V.PC.skill.engineering += .1; this.refresh(); - }, [], passage(), `Costs ${cashFormat(cost * 2)}, will increase upkeep costs, and unlocks exotic felines.`), ['indent']); + }, [], '', `Costs ${cashFormat(cost * 2)}, will increase upkeep costs, and unlocks exotic felines.`), ['indent']); } else { App.UI.DOM.appendNewElement("div", div, App.UI.DOM.disabledLink("Upgrade cages", [`You must be more reputable to be able to house exotic felines.`]), @@ -579,7 +579,7 @@ App.Facilities.Farmyard.farmyard = class extends App.Facilities.Facility { this.refresh(); }, - [], passage(), `Will cost ${cashFormat(cost)}.`), ['indent']); + [], '', `Will cost ${cashFormat(cost)}.`), ['indent']); } return div;