From 887d4eb95282a0b1f5b85180c5ec7f5120fc750a Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 24 Jun 2024 12:30:32 +0200 Subject: [PATCH] improve: purchasing of animation sets, colour plattes, etc. (#394) --- src/services/inventoryService.ts | 22 ++++++++-------------- static/webui/index.html | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 1b2a4ed2..d5a4edb9 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -27,7 +27,7 @@ import { logger } from "@/src/utils/logger"; import { WeaponTypeInternal, getWeaponType, getExalted } from "@/src/services/itemDataService"; import { ISyndicateSacrifice, ISyndicateSacrificeResponse } from "../types/syndicateTypes"; import { IEquipmentClient } from "../types/inventoryTypes/commonInventoryTypes"; -import { ExportCustoms, ExportRecipes, ExportResources } from "warframe-public-export-plus"; +import { ExportCustoms, ExportFlavour, ExportRecipes, ExportResources } from "warframe-public-export-plus"; export const createInventory = async ( accountOwnerId: Types.ObjectId, @@ -112,6 +112,13 @@ export const addItem = async ( } }; } + if (typeName in ExportFlavour) { + return { + InventoryChanges: { + FlavourItems: [await addCustomization(typeName, accountId)] + } + }; + } // Path-based duck typing switch (typeName.substr(1).split("/")[1]) { @@ -171,12 +178,6 @@ export const addItem = async ( [weaponType]: [weapon] } }; - case "Interface": - return { - InventoryChanges: { - FlavourItems: [await addCustomization(typeName, accountId)] - } - }; case "Objects": { // /Lotus/Objects/Tenno/Props/TnoLisetTextProjector (Note Beacon) const inventory = await getInventory(accountId); @@ -196,13 +197,6 @@ export const addItem = async ( } case "Types": switch (typeName.substr(1).split("/")[2]) { - case "AvatarImages": - case "SuitCustomizations": - return { - InventoryChanges: { - FlavourItems: [await addCustomization(typeName, accountId)] - } - }; case "Sentinels": // TOOD: Sentinels should also grant their DefaultUpgrades & SentinelWeapon. const sentinel = await addSentinel(typeName, accountId); diff --git a/static/webui/index.html b/static/webui/index.html index 8d296f2a..037c5280 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -248,7 +248,7 @@