diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index 297866e34c27b9471786c8d8c3042cd00c2cc6b9..c1f2b0f909f29ded6325618622a7eb16394a7ece 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -313,12 +313,13 @@ App.UI.Wardrobe.bellyAccessory = function(slave) { if (item.fs) { clothingOption.FS = item.fs; } - if (item.name.endsWith("belly") && (slave.belly >= 1500 && slave.weight >= 130)) { + if (item.value.endsWith("belly") && (slave.belly >= 1500 && slave.weight >= 130)) { clothingOption.disabled = `${His} stomach is too big to fit an empathy belly around.`; - } else if (item.name === "a support band" && slave.belly <= 10000) { + } else if (item.value === "a support band" && slave.belly <= 10000) { clothingOption.disabled = `${His} stomach is too small to need this.`; } if (item.value !== "none") { + // skip none in set, we set the link elsewhere. optionsArray.push(clothingOption); } }); @@ -362,8 +363,22 @@ App.UI.Wardrobe.buttplug = function(slave) { he, him, his, hers, himself, boy, He, His } = getPronouns(slave); - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {buttplug: `none`}}); + let el = document.createElement('div'); + + let label = document.createElement('div'); + label.append(`Anal accessory: `); + + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.buttplug} `); + label.appendChild(choice); + + if (slave.buttplug !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {buttplug: `none`}}); + label.appendChild(App.UI.Wardrobe.generateRows(choiceOptionsArray, "buttplug", slave, true)); + } + el.appendChild(label); let optionsArray = []; @@ -377,20 +392,27 @@ App.UI.Wardrobe.buttplug = function(slave) { clothingOption.FS = item.fs; } - if (item.name === "long plug") { - if (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset") { - clothingOption.disabled = "disabled"; + if (item.value === "huge plug") { + if (slave.anus < 2) { + clothingOption.disabled = `Slave's anus is too small for this right now`; + } + } else if (item.value === "long plug") { + if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + clothingOption.disabled = "Elites frown on this"; + } + } else if (item.value === "long, large plug") { + if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + clothingOption.disabled = "Elites frown on this"; } - } else if (item.name === "long, large plug") { - if (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset") { - clothingOption.disabled = "disabled"; + } else if (item.value === "long, huge plug") { + if (slave.anus < 2) { + clothingOption.disabled = `Slave's anus is too small for this right now`; } - } else if (item.name === "long, huge plug") { - if (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset") { - clothingOption.disabled = "disabled"; + if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + clothingOption.disabled = "Elites frown on this"; } } - if (item.name !== "none") { + if (item.value !== "none") { // skip none in set, we set the link elsewhere. optionsArray.push(clothingOption); } @@ -399,22 +421,6 @@ App.UI.Wardrobe.buttplug = function(slave) { // Sort optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let el = document.createElement('div'); - - let label = document.createElement('div'); - label.append(`Anal accessory: `); - - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.buttplug} `); - label.appendChild(choice); - - // Choose her own - if (slave.buttplug !== `none`) { - label.appendChild(App.UI.Wardrobe.generateRows(choiceOptionsArray, "buttplug", slave, true)); - } - el.appendChild(label); - // Options let links = document.createElement('div'); links.className = "choices"; @@ -493,8 +499,6 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessChec } }; - - App.UI.Wardrobe.refreshAll = function(slave) { App.UI.Wardrobe.clothes(slave); App.UI.Wardrobe.collar(slave); @@ -502,6 +506,7 @@ App.UI.Wardrobe.refreshAll = function(slave) { App.UI.Wardrobe.shoes(slave); App.UI.Wardrobe.legAccessory(slave); App.UI.Wardrobe.bellyAccessory(slave); + App.UI.Wardrobe.buttplug(slave); return; };