From 650442838140236eff9fe07a09a8a7de238b1f5c Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 26 Jul 2020 23:56:50 -0400 Subject: [PATCH] wig style --- src/js/salon.js | 44 +++++++++----------------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/src/js/salon.js b/src/js/salon.js index 51256ca708d..0da2d8ba27a 100644 --- a/src/js/salon.js +++ b/src/js/salon.js @@ -335,6 +335,7 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo frag.append(wigDye()); } frag.append(wigLength()); + frag.append(wigStyle()); } return jQuery("#salonHair").empty().append(frag); @@ -616,53 +617,26 @@ App.Medicine.Salon.hair = function(slave, {primaryHairColor = 0, secondaryHairCo return frag; } - function hairStyle() { - const frag = new DocumentFragment(); - let p; - let div; - let span; + function wigStyle() { + let div = document.createElement("div"); + div.classList.add("choices"); let method; div = document.createElement("div"); - if (slave.hStyle !== "shaved") { - div.append(`${His} ${slave.hStyle} hair is ${lengthToEitherUnit(slave.hLength)} long. `); - } else { - div.append(`${His} hair is shaved smooth. `); - } - App.UI.DOM.appendNewElement("span", div, `General hairstyles will conform to hair length and clothing choices.`, "note"); - frag.append(div); - - // Normal styles - div = document.createElement("div"); div.classList.add("choices"); - method = (newVal) => { - slave.hStyle = newVal.value; - cashX(forceNeg(V.modCost), "slaveMod", slave); - apply(); - }; - if (slave.hLength > 1) { - div.append(`Style ${his} hair:`); - div.append(createList(App.Medicine.Modification.hairStyles.Normal, method)); + if (slave.hStyle === "bald") { + div.append(`Give ${him} a wig: `); } else { - App.UI.DOM.appendNewElement("span", div, `${His} hair is too short to style meaningfully`, "note"); + div.append(`Set wig style: `); } - frag.append(div); - // Short styles, includes cutting - div = document.createElement("div"); - div.classList.add("choices"); method = (newVal) => { slave.hStyle = newVal.value; - slave.hLength = newVal.hLength; cashX(forceNeg(V.modCost), "slaveMod", slave); apply(); }; - if (slave.hLength > 1) { - div.append(`Cut and style ${his} hair:`); - div.append(createList(App.Medicine.Modification.hairStyles.Cut, method)); - } - frag.append(div); + div.append(createList(App.Medicine.Modification.hairStyles.Normal, method)); - return frag; + return div; } function createList(array, method) { -- GitLab