diff --git a/devTools/types/FC/RA.d.ts b/devTools/types/FC/RA.d.ts index 37ee9b6b548fe1ca808df724b1d2ca3c97402208..1ffbafabf9bd7bda40c534318365b814e4e61819 100644 --- a/devTools/types/FC/RA.d.ts +++ b/devTools/types/FC/RA.d.ts @@ -190,6 +190,7 @@ declare namespace FC { scarDesign: string; hornColor: string; labelTagsClear: boolean; + choosesOwnClothes: 0|1; } interface Rule { diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index 28eccd8f99025436345b5004d00bbf31c8f01705..f9bf72dcecb1786e5717b9608be5b8f0084cae05 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -2141,6 +2141,10 @@ App.Entity.Utils.RARuleDatatypeCleanup = function() { set[acc] = null; } } + if (set.clothes === "choosing her own clothes") { + set.clothes = null; + set.choosesOwnClothes = 1; + } } }(); diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js index b96bcd1f170a6bd61ed44e9593ba8d4ee424672f..f0dda9902085b69dc036e4f347f08194f92a4fb1 100644 --- a/src/interaction/siWardrobe.js +++ b/src/interaction/siWardrobe.js @@ -19,6 +19,7 @@ App.UI.SlaveInteract.wardrobe = function(slave) { const frag = new DocumentFragment(); if (slave.fuckdoll === 0) { frag.append(filtersDOM()); + frag.append(chooseHerOwn()); frag.append(clothes()); frag.append(mask()); frag.append(mouth()); @@ -129,6 +130,45 @@ App.UI.SlaveInteract.wardrobe = function(slave) { return el; } + function chooseHerOwn() { + const el = document.createElement('div'); + const linkArray = []; + + const label = document.createElement('div'); + label.append(`Slave selects ${his} own outfits: `); + + let choice = App.UI.DOM.disabledLink(`${slave.choosesOwnClothes ? "Allowed" : "Forbidden"}`, []); + choice.style.fontWeight = "bold"; + label.appendChild(choice); + + el.appendChild(label); + + linkArray.push( + App.UI.DOM.link( + `Allow`, + () => { + slave.choosesOwnClothes = 1; + refresh(); + }, + ) + ); + + linkArray.push( + App.UI.DOM.link( + `Forbid`, + () => { + slave.choosesOwnClothes = 0; + refresh(); + }, + ) + ); + + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray), "choices") + .append(App.UI.DOM.makeElement("span", " Increases or greatly reduces devotion based on whether the slave is obedient (devotion at accepting or higher).", "note")); + + return el; + } + function clothes() { const clothingDiv = document.createElement('div'); let links; diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 27679e2048ec394781c91b16b53f7344adc3b81b..b2332f8c535a3560f793c51778c33d999692130f 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -182,18 +182,22 @@ globalThis.DefaultRules = (function() { function ProcessClothing(slave, rule) { // apply clothes to slave if ((rule.clothes !== undefined) && (rule.clothes !== null)) { - if ((rule.clothes === "choosing her own clothes")) { - if (slave.choosesOwnClothes === 0) { - slave.clothes = "choosing her own clothes"; - slave.choosesOwnClothes = 1; - r += `<br>${slave.slaveName} is now allowed to choose ${his} own clothes.`; - } - } else if (slave.clothes !== rule.clothes) { + if (slave.clothes !== rule.clothes) { slave.clothes = rule.clothes; slave.choosesOwnClothes = 0; r += `<br>${slave.slaveName} is now wearing ${slave.clothes}.`; } } + if ((rule.choosesOwnClothes !== undefined) && (rule.choosesOwnClothes !== null)) { + if (slave.choosesOwnClothes !== rule.choosesOwnClothes) { + slave.choosesOwnClothes = rule.choosesOwnClothes; + if (slave.choosesOwnClothes) { + r += `<br>${slave.slaveName} is now allowed to choose ${his} own clothes.`; + } else { + r += `<br>${slave.slaveName} is now forbidden from choosing ${his} own clothes.`; + } + } + } } /** diff --git a/src/js/rulesAssistant.js b/src/js/rulesAssistant.js index 52199fd9c050ef135adb64295328edc9dd7e1c47..c4857c8310a09f4507919e2c189d1d7cadbe1000 100644 --- a/src/js/rulesAssistant.js +++ b/src/js/rulesAssistant.js @@ -219,6 +219,7 @@ App.RA.newRule = function() { clitSettingXX: null, clitSettingEnergy: null, speechRules: null, + choosesOwnClothes: null, clothes: null, collar: null, faceAccessory: null, diff --git a/src/js/rulesAssistantOptions.js b/src/js/rulesAssistantOptions.js index 3e03234e13f6d93c107430ada628b1c4cca68e38..631b199c498155016c534b7431b0990f74a5991b 100644 --- a/src/js/rulesAssistantOptions.js +++ b/src/js/rulesAssistantOptions.js @@ -1697,6 +1697,7 @@ App.RA.options = (function() { class AppearanceTab extends Tab { constructor(tabButtons) { super("appearance", "Appearance", tabButtons); + this.appendChild(new ChoosesOwnClothes()); this.appendChild(new ClothesList()); this.appendChild(new CollarList()); this.appendChild(new GagList()); @@ -1903,11 +1904,20 @@ App.RA.options = (function() { } } - class ClothesList extends List { + class ChoosesOwnClothes extends RadioSelector { constructor() { const items = [ - ["Select her own outfit", "choosing her own clothes"] + ["allow", 1], + ["forbid", 0], ]; + super("Choose own clothing", items, true); + this.setValue(current_rule.set.choosesOwnClothes); + this.onchange = (value) => current_rule.set.choosesOwnClothes = value; + } + } + class ClothesList extends List { + constructor() { + const items = []; super("Clothes", items); const nClothes = isItemAccessible.array(App.Data.clothes, "harsh", false);