From 04ef35d7cba10a968f56abe77c9e5482529de13e Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Fri, 5 Jun 2020 20:56:07 -0400 Subject: [PATCH] armwear --- src/interaction/wardrobeUse.js | 2 +- src/npc/descriptions/style/armwear.js | 44 +++++++++++++++++++++++ src/uncategorized/longSlaveDescription.tw | 1 + src/utility/descriptionWidgetsStyle.tw | 14 -------- 4 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 src/npc/descriptions/style/armwear.js diff --git a/src/interaction/wardrobeUse.js b/src/interaction/wardrobeUse.js index ed249dadbac..0cef5bc29b8 100644 --- a/src/interaction/wardrobeUse.js +++ b/src/interaction/wardrobeUse.js @@ -277,7 +277,7 @@ App.UI.Wardrobe.armAccessory = function(slave) { } let el = document.createElement('div'); - // <<armwearDescription>> + // <<App.Desc.armwear($activeSlave)>> let label = document.createElement('div'); label.append(`Arm accessory: `); diff --git a/src/npc/descriptions/style/armwear.js b/src/npc/descriptions/style/armwear.js new file mode 100644 index 00000000000..fa1fbc29ce7 --- /dev/null +++ b/src/npc/descriptions/style/armwear.js @@ -0,0 +1,44 @@ +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} + */ +App.Desc.armwear = function(slave) { + const r = []; + const { + his, He + } = getPronouns(slave); + // TODO: check clothing descriptions for glove references + if (hasAnyArms(slave)) { + switch (slave.armAccessory) { + case "hand gloves": + r.push(`${He} is wearing a pair of simple gloves that covers ${his}`); + if (hasBothArms(slave)) { + r.push(`hands`); + } else { + r.push(`hand`); + } + r.push(`up to ${his}`); + if (hasBothArms(slave)) { + r.push(`wrists.`); + } else { + r.push(`wrist.`); + } + break; + case "elbow gloves": + r.push(`${He} is wearing a pair of long gloves that covers ${his}`); + if (hasBothArms(slave)) { + r.push(`arms`); + } else { + r.push(`arm`); + } + r.push(`until just past ${his}`); + if (hasBothArms(slave)) { + r.push(`elbows.`); + } else { + r.push(`elbow.`); + } + } + } + + return r.join(" "); +}; diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index bcb84154009..8796e272d82 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -1478,6 +1478,7 @@ is <<= App.Desc.limbs($activeSlave)>> <<= App.Desc.clothing($activeSlave)>> +<<= App.Desc.armwear($activeSlave)>> <<if $showBodyMods == 1>> <<clothingCorsetDescription>> <</if>> diff --git a/src/utility/descriptionWidgetsStyle.tw b/src/utility/descriptionWidgetsStyle.tw index 626dc4abdd3..9e8fb06780c 100644 --- a/src/utility/descriptionWidgetsStyle.tw +++ b/src/utility/descriptionWidgetsStyle.tw @@ -1,19 +1,5 @@ :: clothing description widgets [widget nobr] -<<widget "armwearDescription">> -/* check clothing descriptions from above for glove references */ -<<if (hasAnyArms($activeSlave))>> - <<switch $activeSlave.armAccessory>> - <<case "hand gloves">> - $He is wearing a pair of simple gloves that covers $his hand<<if hasBothArms($activeSlave)>>s<</if>> up to $his wrist<<if hasBothArms($activeSlave)>>s<</if>>. - - <<case "elbow gloves">> - $He is wearing a pair of long gloves that covers $his arm<<if hasBothArms($activeSlave)>>s<</if>> until just past $his elbow<<if hasBothArms($activeSlave)>>s<</if>>. - - <</switch>> -<</if>> -<</widget>> - <<widget "clothingCorsetDescription">> <<switch $activeSlave.clothes>> <<case "a Fuckdoll suit">> -- GitLab