feat(webui): add relics via "add items" (#1066)

Closes #1062

Reviewed-on: OpenWF/SpaceNinjaServer#1066
Co-authored-by: Sainan <sainan@calamity.inc>
Co-committed-by: Sainan <sainan@calamity.inc>
This commit is contained in:
Sainan 2025-03-02 04:21:59 -08:00 committed by OrdisPrime
parent 9158209059
commit 8a6f36a9b0

View File

@ -6,12 +6,14 @@ import {
ExportGear, ExportGear,
ExportMisc, ExportMisc,
ExportRecipes, ExportRecipes,
ExportRelics,
ExportResources, ExportResources,
ExportSentinels, ExportSentinels,
ExportSyndicates, ExportSyndicates,
ExportUpgrades, ExportUpgrades,
ExportWarframes, ExportWarframes,
ExportWeapons ExportWeapons,
TRelicQuality
} from "warframe-public-export-plus"; } from "warframe-public-export-plus";
import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json"; import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json";
@ -23,6 +25,13 @@ interface ListedItem {
badReason?: "starter" | "frivolous" | "notraw"; badReason?: "starter" | "frivolous" | "notraw";
} }
const relicQualitySuffixes: Record<TRelicQuality, string> = {
VPQ_BRONZE: "",
VPQ_SILVER: " [Flawless]",
VPQ_GOLD: " [Radiant]",
VPQ_PLATINUM: " [Exceptional]"
};
const getItemListsController: RequestHandler = (req, response) => { const getItemListsController: RequestHandler = (req, response) => {
const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en"); const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en");
const res: Record<string, ListedItem[]> = {}; const res: Record<string, ListedItem[]> = {};
@ -108,11 +117,24 @@ const getItemListsController: RequestHandler = (req, response) => {
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang)); name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
} }
} }
if (uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/") {
res.miscitems.push({ res.miscitems.push({
uniqueName: item.productCategory + ":" + uniqueName, uniqueName: item.productCategory + ":" + uniqueName,
name: name name: name
}); });
} }
}
for (const [uniqueName, item] of Object.entries(ExportRelics)) {
res.miscitems.push({
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)) { for (const [uniqueName, item] of Object.entries(ExportGear)) {
res.miscitems.push({ res.miscitems.push({
uniqueName: "Consumables:" + uniqueName, uniqueName: "Consumables:" + uniqueName,