Skip to content
Snippets Groups Projects
Commit 5078c774 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

outfit testing

parent c1fc321f
No related branches found
No related tags found
1 merge request!7504Wardrobe shopping to DOM
......@@ -86,13 +86,14 @@ App.UI.WardrobeShopping = function() {
const cost = Math.trunc(clothingObj.cost * V.upgradeMultiplierTrade);
let div;
if (V.seeImages === 1) {
// If we have more than one possible outfit to showcase, make sure not to show the outfit we did last time.
const clothesArray = clothingObj.contains.length > 1 ? clothingObj.contains.filter(item => item !== oldOutfit) : clothingObj.contains;
// If we have more than one possible outfit to showcase, make sure not to show the outfit we did last time.
const clothesArray = clothingObj.contains.length > 1 ? clothingObj.contains.filter(item => item !== oldOutfit) : clothingObj.contains;
// Get a randomly chosen piece of clothing from the set to display:
model.clothes = clothesArray[Math.floor(Math.random() * clothesArray.length)];
// Get a randomly chosen piece of clothing from the set to display
// This piece will also later be checked to see if we can purchase it or not.
model.clothes = clothesArray[Math.floor(Math.random() * clothesArray.length)];
if (V.seeImages === 1) {
// Some clothing is weird (looking at you, Egyptian necklace)
if (clothingObj.hasOwnProperty("modelUpdate")) {
Object.assign(model, clothingObj.modelUpdate);
......@@ -113,7 +114,7 @@ App.UI.WardrobeShopping = function() {
jQuery(`#${clothing}`).empty().append(createCell(clothing, model.clothes));
};
}
if (!V.boughtItem.clothing[clothing]) {
if (!isItemAccessible.entry(model.clothes, "clothing")) {
if (cost < V.cash) {
App.UI.DOM.appendNewElement(
"div",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment