diff --git a/js/003-data/miscData.js b/js/003-data/miscData.js index 66c23ef5022274b68a2278438b51e57d896036d1..8037f1eb1c42b56547e8c270172d1dc41272fde4 100644 --- a/js/003-data/miscData.js +++ b/js/003-data/miscData.js @@ -2170,19 +2170,19 @@ App.Data.misc = { { name: "Platforms", value: "platform shoes", - fs: "statuesque", + fs: "FSStatuesqueGlorification", rs: "boughtShoes" }, { name: "Platform heels", value: "platform heels", - fs: "statuesque", + fs: "FSStatuesqueGlorification", rs: "boughtShoes" }, { name: "Painfully extreme platform heels", value: "extreme platform heels", - fs: "statuesque", + fs: "FSStatuesqueGlorification", rs: "boughtShoes" } ], diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index eb2139a73280ae3614c46ed6a574d8b8ad33b614..8f63cad1b1dda168f50f5f3171320a8a5664e530 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -224,6 +224,7 @@ window.isClothingAccessible = (function() { niceDB = App.Data.misc.niceCollars; harshDB = App.Data.misc.harshCollars; } else { + console.log(category); 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 159b1ef3145b22042d4d1ab996eb50a092c2ddf6..8bfc0064b8f0f452dbfeadec4616f310d214bd42 100644 --- a/src/js/wardrobeUse.js +++ b/src/js/wardrobeUse.js @@ -465,7 +465,7 @@ App.UI.Wardrobe.shoes = function(slave) { // Options let links = document.createElement('div'); links.className = "choices"; - links.appendChild(generateRows(optionsArray)); + links.appendChild(App.UI.Wardrobe.generateRows(optionsArray, "shoes", slave)); el.appendChild(links); return jQuery('#shoes').empty().append(el); @@ -578,81 +578,81 @@ App.UI.Wardrobe.legAccessory = function(slave) { {text: "Short stockings", updateSlave: {legAccessory: "short stockings"}}, {text: "Long stockings", updateSlave: {legAccessory: "long stockings"}} ]; - links.appendChild(generateRows(array)); + links.appendChild(App.UI.Wardrobe.generateRows(array, "legAccessory", slave, true)); el.appendChild(links); return jQuery('#legAccessory').empty().append(el); +}; - - function generateRows(array) { - let row = document.createElement('span'); - for (let i = 0; i < array.length; i++) { - let link; - const separator = document.createTextNode(` | `); - const keys = Object.keys(array[i]); - - // Test to see if there was a problem with the key - for (let j = 0; j < keys.length; j++) { - if (["FS", "text", "updateSlave", "update", "note", "disabled"].includes(keys[j])) { - continue; - } else { - array[i].text += " ERROR, THIS SCENE WAS NOT ENTERED CORRECTLY"; - console.log("Trash found while generateRows() was running: " + keys[j] + ": " + array[i][keys[j]]); - break; - } +App.UI.Wardrobe.generateRows = function(array, category, slave, ignoreAccessCheck="false") { //cateogy 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++) { + let link; + const separator = document.createTextNode(` | `); + const keys = Object.keys(array[i]); + + // Test to see if there was a problem with the key + for (let j = 0; j < keys.length; j++) { + if (["FS", "text", "updateSlave", "update", "note", "disabled"].includes(keys[j])) { + continue; + } else { + array[i].text += " ERROR, THIS SCENE WAS NOT ENTERED CORRECTLY"; + console.log("Trash found while generateRows() was running: " + keys[j] + ": " + array[i][keys[j]]); + break; } - // if (array[i].updateSlave.legAccessory === `none` || isClothingAccessible.entry(array[i].updateSlave.legAccessory, "legAccessory")) { - // is it just text? - if (array[i].disabled) { - link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); - } else { - link = document.createElement('span'); - - // Set up the link - link.appendChild( - App.UI.DOM.link( - `${array[i].text} `, - () => { click(array[i]); }, - ) - ); - - if (array[i].FS) { - let FS = array[i].FS.substring(2); // Given "FSEdoRevivalist", cut off the first two letters to start a user friendly tooltip - FS = FS.replace(/([A-Z])/g, ` $1`); // Given "EdoRevivalist", find every capital letter and put a space in front of it - FS = App.UI.DOM.disabledLink(`FS`, [FS]); // Tooltip should read "Edo Revivalist" - FS.style.fontStyle = "italic"; - link.appendChild(FS); - } - - // add a note node if required - if (array[i].note) { - let note = document.createElement('span'); - note.textContent = (` ${array[i].note}`); - note.className = "note"; - link.appendChild(note); - } + } + if (ignoreAccessCheck === true || isClothingAccessible.entry(array[i].updateSlave[category], `${category}`)) { + // is it just text? + if (array[i].disabled) { + link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]); + } else { + link = document.createElement('span'); + + // Set up the link + link.appendChild( + App.UI.DOM.link( + `${array[i].text} `, + () => { click(array[i]); }, + ) + ); + + if (array[i].FS) { + let FS = array[i].FS.substring(2); // Given "FSEdoRevivalist", cut off the first two letters to start a user friendly tooltip + FS = FS.replace(/([A-Z])/g, ` $1`); // Given "EdoRevivalist", find every capital letter and put a space in front of it + FS = App.UI.DOM.disabledLink(`FS`, [FS]); // Tooltip should read "Edo Revivalist" + FS.style.fontStyle = "italic"; + link.appendChild(FS); } - row.appendChild(link); - if (i < array.length-1) { - row.appendChild(separator); + + // add a note node if required + if (array[i].note) { + let note = document.createElement('span'); + note.textContent = (` ${array[i].note}`); + note.className = "note"; + link.appendChild(note); } - //} + } + row.appendChild(link); + if (i < array.length-1) { + row.appendChild(separator); + } } + } - return row; + return row; - function click(arrayOption) { - if (arrayOption.updateSlave) { - Object.assign(slave, arrayOption.updateSlave); - } - if (arrayOption.update) { - Object.assign(V, arrayOption.update); - } - App.UI.Wardrobe.refreshAll(slave); - return; + function click(arrayOption) { + if (arrayOption.updateSlave) { + Object.assign(slave, arrayOption.updateSlave); } + if (arrayOption.update) { + Object.assign(V, arrayOption.update); + } + App.UI.Wardrobe.refreshAll(slave); + return; } -}; +} +