diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index fdead4db832bcfc37cdb273b7706d2b535e012fb..c9bbfadff9186a6297c407ca434b5c5f42f186f3 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -2489,7 +2489,7 @@ App.Data.misc = { if (V.toysBoughtButtPlugs > 0) { if (slave) { if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - return false; + return "Elites frown on this"; } else{ return true; } @@ -2511,7 +2511,7 @@ App.Data.misc = { if (V.toysBoughtButtPlugs > 0) { if (slave) { if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - return false; + return "Elites frown on this"; } else { return true; } @@ -2527,7 +2527,7 @@ App.Data.misc = { unlock: function(slave) { if (slave) { if (slave.anus < 2) { - return false; // clothingOption.disabled = `Slave's anus is too small for this right now`; + return `Slave's anus is too small for this right now`; } else { return true; } @@ -2544,9 +2544,9 @@ App.Data.misc = { if (V.toysBoughtButtPlugs > 0) { if (slave) { if (slave.anus < 2) { - return false; // clothingOption.disabled = `Slave's anus is too small for this right now`; + return `Slave's anus is too small for this right now`; } else if (!(slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - return false; // clothingOption.disabled = "Elites frown on this"; + return "Elites frown on this"; } else { return true; } diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 1afbb299350bd4917b17f295048b93b5877cd1f5..ad14c3622089679008aced8963993e7337d7a361 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -209,14 +209,14 @@ window.isClothingAccessible = (function() { /** * Checks whether clothing is accessible * @param {string} string Name of wearable item - * @returns {boolean} + * @returns {boolean|string} Returns true if it is accessible, and if it is not either false or a string explaining why */ function entry(string, category="clothing", slave) { if (V.cheatMode === 1) { return true; } - let niceDB; - let harshDB; + let niceDB = []; + let harshDB = []; if (["clothing", "clothes"].includes(category)) { niceDB = App.Data.misc.niceClothes; harshDB = App.Data.misc.harshClothes; @@ -238,6 +238,7 @@ window.isClothingAccessible = (function() { //} 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]; } let item = niceDB.find((i) => i.value === string); diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js index 25bbbdf3e424c89f1c5295bb689d61e12bfcd203..d36e98e3058ec3e62f73b8a8dfa9bb9d7b5a1ec1 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -485,10 +485,17 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessChec break; } } - if (ignoreAccessCheck === true || isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave)) { + // Some items will never be in App.data.misc, especially "none" if it falls in between harsh and nice data sets. Trying to look it up would cause an error, which is what access check works around. + let unlocked; + if (ignoreAccessCheck === false) { + unlocked = isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave); + } + if (ignoreAccessCheck === true || unlocked) { // is it just text? if (array[i].disabled) { link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); + } else if (typeof unlocked === 'string') { + link = App.UI.DOM.disabledLink(array[i].text, [unlocked]); } else { link = document.createElement('span');