From ecc8a65d28fda94a193b826ad15036138c4b0d82 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 29 Feb 2024 15:59:31 -0600 Subject: [PATCH] WIP(customizations): animal bits --- website/common/script/libs/getItemInfo.js | 2 +- website/common/script/libs/shops.js | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/website/common/script/libs/getItemInfo.js b/website/common/script/libs/getItemInfo.js index 2f1cf56fe7..5acb5e9905 100644 --- a/website/common/script/libs/getItemInfo.js +++ b/website/common/script/libs/getItemInfo.js @@ -235,7 +235,7 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang case 'gear': // spread operator not available itemInfo = Object.assign(getDefaultGearProps(item, language), { - value: item.twoHanded ? 2 : 1, + value: item.twoHanded || item.gearSet === 'animal' ? 2 : 1, currency: 'gems', pinType: 'gear', }); diff --git a/website/common/script/libs/shops.js b/website/common/script/libs/shops.js index caf951ee96..c82138a3d0 100644 --- a/website/common/script/libs/shops.js +++ b/website/common/script/libs/shops.js @@ -677,15 +677,31 @@ shops.getCustomizationsShopCategories = function getCustomizationsShopCategories const animalEarsCategory = { identifier: 'animalEars', text: i18n.t('animalEars', language), - items: [], }; + animalEarsCategory.items = values(content.gear.tree.headAccessory.special) + .filter(gearItem => { + const { owned } = user.items.gear; + if (typeof owned[gearItem.key] !== 'undefined') { + return false; + } + return gearItem.gearSet === 'animal'; + }) + .map(gearItem => getItemInfo(user, 'gear', gearItem, officialPinnedItems, language)); categories.push(animalEarsCategory); const animalTailsCategory = { identifier: 'animalTails', text: i18n.t('animalTails', language), - items: [], }; + animalTailsCategory.items = values(content.gear.tree.back.special) + .filter(gearItem => { + const { owned } = user.items.gear; + if (typeof owned[gearItem.key] !== 'undefined') { + return false; + } + return gearItem.gearSet === 'animal'; + }) + .map(gearItem => getItemInfo(user, 'gear', gearItem, officialPinnedItems, language)); categories.push(animalTailsCategory); const shirtsCategory = {