diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index c50d1231077fa042d8f1c5c102a5335a9fd08ad6..6444c19b3435b92e14e2868a0d4316b6c301331a 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -223,6 +223,8 @@ window.isClothingAccessible = (function() { } else if (category === "collar") { niceDB = App.Data.misc.niceCollars; harshDB = App.Data.misc.harshCollars; + } else if (category === "bellyAccessory") { + niceDB = App.Data.misc.bellyAccessories; } else { niceDB = App.Data.misc[category]; } diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index 3546b264114fe99dbdff2f967d72c79cf8914f45..f50c22fb44397c7a462886a0f9476ae1b4013586 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -288,6 +288,65 @@ App.UI.Wardrobe.legAccessory = function(slave) { return jQuery('#legAccessory').empty().append(el); }; +App.UI.Wardrobe.bellyAccessory = function(slave) { + if (slave.fuckdoll !== 0) { + return; + } + + const + { + // eslint-disable-next-line no-unused-vars + he, him, his, hers, himself, boy, He, His + } = getPronouns(slave); + + let choiceOptionsArray= []; + choiceOptionsArray.push({text: `None`, updateSlave: {bellyAccessory: `none`}}); + + let optionsArray= []; + + let clothingOption; + App.Data.misc.bellyAccessories.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {bellyAccessory: item.value} + }; + if (item.fs) { + clothingOption.FS = item.fs; + } + if (item.value !== "none") { + optionsArray.push(clothingOption); + } + }); + + // Sort + optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + + let el = document.createElement('div'); + + let label = document.createElement('div'); + label.append(`Belly accessory: `); + + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.bellyAccessory} `); + label.appendChild(choice); + + // Choose her own + if (slave.bellyAccessory !== `none`) { + label.appendChild(App.UI.Wardrobe.generateRows(choiceOptionsArray, "bellyAccessory", slave, true)); + } + + el.appendChild(label); + + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "bellyAccessory", slave)); + el.appendChild(links); + + return jQuery('#bellyAccessory').empty().append(el); +}; + App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessCheck="false") { // category should be in the form of slave.category, the thing we want to update. let row = document.createElement('span'); for (let i = 0; i < array.length; i++) { diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 307d47c23b0b7b02695db8bc4d8457d1c0e37f18..c9ffd3dc3878a417940611f8598b790cae49fd0a 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -213,6 +213,9 @@ <script>App.UI.Wardrobe.legAccessory(V.activeSlave)</script> <</if>> + <span id="bellyAccessory"></span> + <script>App.UI.Wardrobe.bellyAccessory(V.activeSlave)</script> + <br>Torso accessory: ''<span id="bellyAccessory">$activeSlave.bellyAccessory</span>.'' <<link "None">><<set $activeSlave.bellyAccessory = "none">><<replace "#bellyAccessory">>$activeSlave.bellyAccessory<</replace>><</link>> | <<link "Tight corset">><<set $activeSlave.bellyAccessory = "a corset">><<replace "#bellyAccessory">>$activeSlave.bellyAccessory<</replace>><</link>>