diff --git a/src/facilities/salon/salonPassage.js b/src/facilities/salon/salonPassage.js index c57a2e49a8cb8368c68c3c913de0fa28311ff333..767dd2daa976f9f1d5414675683d8eafb6b2acf8 100644 --- a/src/facilities/salon/salonPassage.js +++ b/src/facilities/salon/salonPassage.js @@ -21,11 +21,11 @@ App.UI.salon = function(slave, cheat = false) { const el = new DocumentFragment(); if (!cheat) { if (V.seeImages > 0) { - App.Events.drawEventArt(el, slave); + //App.Events.drawEventArt(el, slave); } el.append(intro()); } - el.append(piercings()); + el.append(eyewear()); return el; } @@ -36,41 +36,34 @@ App.UI.salon = function(slave, cheat = false) { return el; } - function piercings() { + function eyewear() { const el = new DocumentFragment(); - // DESCRIPTIONS App.UI.DOM.appendNewElement("h2", el, "Eyewear"); const r = []; const options = new App.UI.OptionsGroup(); - const eyeOptions = new Map([["Cosmetic glasses", "glasses"]]); - if (slave.eyewear !== "none") { - eyeOptions.set("Remove", "none"); - } - let note = ""; if (getBestVision(slave) === 0) { - r.push(`${He} is blind, and`); + r.push(`${He} is blind`); } else if (anyVisionEquals(slave, 1)) { - r.push(`${He} is nearsighted, and ${he}`); - eyeOptions.set("Corrective glasses", "corrective glasses"); - eyeOptions.set("Corrective contacts", "corrective contacts"); + r.push(`${He} is nearsighted`); } else { - r.push(`${His} vision is normal, and ${he}`); - eyeOptions.set("Blurring glasses", "blurring glasses"); - eyeOptions.set("Blurring contacts", "blurring contacts"); - note = "Blurring options are annoying and impede performance on some assignments."; + r.push(`${His} vision is normal`); } - if (slave.eyewear === "none") { - r.push(`has no eyewear.`); + const option = options.addOption(r.join(" "), "eyewear", slave) + .addValue("None", "none") + .addValue("Cosmetic glasses", "glasses", billMod); + if (getBestVision(slave) !== 0 && anyVisionEquals(slave, 1)) { + option.addValue("Corrective glasses", "corrective glasses", billMod); + option.addValue("Corrective glasses", "corrective glasses", billMod); } else { - r.push(`is wearing ${slave.eyewear}.`); + option.addValue("Blurring glasses", "blurring glasses", billMod); + option.addValue("Blurring glasses", "blurring glasses", billMod); + option.addComment("Blurring options are annoying and impede performance on some assignments."); } + el.append(options.render()); - options.addOption(r.join(" "), "eyewear", slave) - .addValueMap(eyeOptions) - .addCallbackToEach(billMod) - .addComment(note); + el.append(App.Medicine.Modification.eyeSelector(slave, cheat)); return el; } diff --git a/src/js/salon.js b/src/js/salon.js index 9a0e8ccdfd578613e480eb56978c00c947dab257..7444832a3bafadddb67dd96904ba2c303ee20c31 100644 --- a/src/js/salon.js +++ b/src/js/salon.js @@ -1,8 +1,9 @@ /** * @param {FC.HumanState} entity + * @param {Boolean} cheat * @returns {HTMLDivElement} */ -App.Medicine.Modification.eyeSelector = function(entity) { +App.Medicine.Modification.eyeSelector = function(entity, cheat = false) { const {He, him, his} = getPronouns(entity); const player = entity === V.PC; @@ -166,7 +167,9 @@ App.Medicine.Modification.eyeSelector = function(entity) { selectedPupil === "none" ? "" : selectedPupil, selectedSclera === "none" ? "" : selectedSclera, selectedSide); - cashX(forceNeg(V.modCost), "slaveMod", entity); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", entity); + } App.UI.reload(); } @@ -226,9 +229,10 @@ App.Medicine.Modification.eyeSelector = function(entity) { * @param {object} params * @param {number|string} [params.primaryEarColor=0] * @param {string} [params.secondaryEarColor=""] + * @param {Boolean} [params.cheat=false] * @returns {JQuery<HTMLElement>} */ -App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColor = ""} = {}) { +App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColor = "", cheat = false} = {}) { const frag = new DocumentFragment(); let updatePrimary = (newVal) => { primaryEarColor = newVal; apply(); }; let updateSecondary = (newVal) => { secondaryEarColor = newVal; apply(); }; @@ -280,7 +284,9 @@ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColo () => { slave.earTColor = (primaryEarColor + secondaryEarColor); App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } App.Medicine.Salon.ears(slave); // discard selections after locking them in. } ) @@ -322,9 +328,10 @@ App.Medicine.Salon.ears = function(slave, {primaryEarColor = 0, secondaryEarColo * @param {object} params * @param {number|string} [params.primaryHairColor] * @param {string} [params.secondaryHairColor] + * @param {Boolean} [params.cheat=false] * @returns {JQuery<HTMLElement>} */ -App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairColor = ""} = {}) { +App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairColor = "", cheat = false} = {}) { const frag = new DocumentFragment(); let updatePrimary = (newVal) => { primaryHairColor = newVal.value; apply(); }; let updateSecondary = (newVal) => { secondaryHairColor = newVal.value; apply(); }; @@ -362,7 +369,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo () => { slave.hColor = slave.origHColor; App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); } ) @@ -395,7 +404,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo () => { slave.hColor = (primaryHairColor + secondaryHairColor); App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } App.Medicine.Salon.hair(slave); // discard selections after locking them in. } ) @@ -424,7 +435,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo div.classList.add("choices"); method = (newVal) => { slave.hStyle = newVal.value; - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); }; if (slave.hLength > 1) { @@ -441,7 +454,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo method = (newVal) => { slave.hStyle = newVal.value; slave.hLength = newVal.hLength; - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); }; if (slave.hLength > 1) { @@ -481,7 +496,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo v = Math.round(v * 2.54); } slave.hLength = v; - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); }, true @@ -568,7 +585,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo () => { slave.earTColor = (primaryHairColor + secondaryHairColor); App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } App.Medicine.Salon.hair(slave); // discard selections after locking them in. } ) @@ -611,7 +630,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo v = Math.round(v * 2.54); } slave.hLength = v; - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); }, true @@ -634,7 +655,9 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo div.classList.add("choices"); const method = (newVal) => { slave.hStyle = newVal.value; - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); }; @@ -694,9 +717,10 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo * @param {object} params * @param {number|string} [params.primaryTailColor] * @param {string} [params.secondaryTailColor] + * @param {Boolean} [params.cheat] * @returns {JQuery<HTMLElement>} */ -App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailColor = ""} = {}) { +App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailColor = "", cheat = false} = {}) { const frag = new DocumentFragment(); let updatePrimary = (newVal) => { primaryTailColor = newVal.value; apply(); }; let updateSecondary = (newVal) => { secondaryTailColor = newVal.value; apply(); }; @@ -723,7 +747,9 @@ App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailCo () => { slave.tailColor = slave.hColor; App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } apply(); } ) @@ -756,7 +782,9 @@ App.Medicine.Salon.tail = function(slave, {primaryTailColor = 0, secondaryTailCo () => { slave.tailColor = (primaryTailColor + secondaryTailColor); App.Art.refreshSlaveArt(slave, 3, "art-frame"); - cashX(forceNeg(V.modCost), "slaveMod", slave); + if (!cheat) { + cashX(forceNeg(V.modCost), "slaveMod", slave); + } App.Medicine.Salon.tail(slave); // discard selections after locking them in. } )