From 8a6f36a9b0bd91a524bada4fe81dc47393608103 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 2 Mar 2025 04:21:59 -0800 Subject: [PATCH] feat(webui): add relics via "add items" (#1066) Closes #1062 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1066 Co-authored-by: Sainan Co-committed-by: Sainan --- .../custom/getItemListsController.ts | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index ce80d041..6534bf92 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -6,12 +6,14 @@ import { ExportGear, ExportMisc, ExportRecipes, + ExportRelics, ExportResources, ExportSentinels, ExportSyndicates, ExportUpgrades, ExportWarframes, - ExportWeapons + ExportWeapons, + TRelicQuality } from "warframe-public-export-plus"; import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json"; @@ -23,6 +25,13 @@ interface ListedItem { badReason?: "starter" | "frivolous" | "notraw"; } +const relicQualitySuffixes: Record = { + VPQ_BRONZE: "", + VPQ_SILVER: " [Flawless]", + VPQ_GOLD: " [Radiant]", + VPQ_PLATINUM: " [Exceptional]" +}; + const getItemListsController: RequestHandler = (req, response) => { const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en"); const res: Record = {}; @@ -108,9 +117,22 @@ const getItemListsController: RequestHandler = (req, response) => { name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang)); } } + if (uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/") { + res.miscitems.push({ + uniqueName: item.productCategory + ":" + uniqueName, + name: name + }); + } + } + for (const [uniqueName, item] of Object.entries(ExportRelics)) { res.miscitems.push({ - uniqueName: item.productCategory + ":" + uniqueName, - name: name + uniqueName: "MiscItems:" + uniqueName, + name: + getString("/Lotus/Language/Relics/VoidProjectionName", lang) + .split("|ERA|") + .join(item.era) + .split("|CATEGORY|") + .join(item.category) + relicQualitySuffixes[item.quality] }); } for (const [uniqueName, item] of Object.entries(ExportGear)) {