diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index ad14c3622089679008aced8963993e7337d7a361..f173c3d4253fd1e852e128c53a9c801677155cae 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -217,29 +217,44 @@ window.isClothingAccessible = (function() { } let niceDB = []; let harshDB = []; - if (["clothing", "clothes"].includes(category)) { - niceDB = App.Data.misc.niceClothes; - harshDB = App.Data.misc.harshClothes; - } else if (category === "collar") { - niceDB = App.Data.misc.niceCollars; - harshDB = App.Data.misc.harshCollars; - } else if (category === "bellyAccessory") { - niceDB = App.Data.misc.bellyAccessories; - } else if (category === "buttplug") { - niceDB = App.Data.misc.buttplugs; - } else if (category === "buttplugAttachment") { - niceDB = App.Data.misc.buttplugAttachments; - } else if (category === "vaginalAccessory") { - niceDB = App.Data.misc.vaginalAccessories; - } else if (category === "vaginalAttachment") { - niceDB = App.Data.misc.vaginalAttachments; - } else if (category === "dickAccessory") { - niceDB = App.Data.misc.vaginalAccessories; - //} else if (category === "chastity") { - // niceDB = App.Data.misc.vaginalAccessories; //this is going to be weird, they aren't in App.Data.Misc - } else { - console.log(`made a category for ${category} automatically, may need to define this by hand`); - niceDB = App.Data.misc[category]; + switch (category) { + case "clothing": + case "clothes": + niceDB = App.Data.misc.niceClothes; + harshDB = App.Data.misc.harshClothes; + break; + case "collar": + niceDB = App.Data.misc.niceCollars; + harshDB = App.Data.misc.harshCollars; + break; + case "bellyAccessory": + niceDB = App.Data.misc.bellyAccessories; + break; + case "buttplug": + niceDB = App.Data.misc.buttplugs; + break; + case "buttplugAttachment": + niceDB = App.Data.misc.buttplugAttachments; + break; + case "vaginalAccessory": + niceDB = App.Data.misc.vaginalAccessories; + break; + case "vaginalAttachment": + niceDB = App.Data.misc.vaginalAttachments; + break; + case "dickAccessory": + niceDB = App.Data.misc.vaginalAccessories; + break; + case "shoes": + niceDB = App.Data.misc.shoes; + break; + //case "chastity": + // niceDB = App.Data.misc.vaginalAccessories; //this is going to be weird, they aren't in App.Data.Misc + // break; + default: + console.log(`made a category for ${category} automatically, may need to define this by hand`); + niceDB = App.Data.misc[category]; + break; } let item = niceDB.find((i) => i.value === string); if (!item && (typeof harshDB !== 'undefined')) { @@ -285,20 +300,7 @@ window.isClothingAccessible = (function() { } } if (item.hasOwnProperty("unlock")) { - if (typeof item.unlock === 'object') { - let keys = Object.keys(item.unlock); - for (let key in keys) { - if (keys[key] === "continent" && V.continent === item.unlock[keys[key]]) { - return true; - } else if (V[keys[key]] > 0 ) { - return true; - } - } - } else if (typeof item.unlock === 'function') { - if (item.unlock(slave)) { - return true; - } - } + return item.unlock(slave); } return false; } diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index d2fefe05ae1c70ed604a8d4e567b96303f2aa640..77998c611fc86632c8d2b5afd86457e96202dbd7 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -490,6 +490,7 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, accessCheck=fals if (accessCheck === true) { unlocked = isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave, true); } + console.log(category, unlocked); if (accessCheck === false || unlocked) { // is it just text? if (array[i].disabled) {