XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

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

Closes #1062 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1066 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>

8a6f36a9
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +25 -3
Modified src/controllers/custom/getItemListsController.ts +25 -3
@@ -6,12 +6,14 @@ import {
6 6 ExportGear,
7 7 ExportMisc,
8 8 ExportRecipes,
9 ExportRelics,
9 10 ExportResources,
10 11 ExportSentinels,
11 12 ExportSyndicates,
12 13 ExportUpgrades,
13 14 ExportWarframes,
14 ExportWeapons
15 ExportWeapons,
16 TRelicQuality
15 17 } from "warframe-public-export-plus";
16 18 import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json";
17 19
@@ -23,6 +25,13 @@ interface ListedItem {
23 25 badReason?: "starter" | "frivolous" | "notraw";
24 26 }
25 27
28 const relicQualitySuffixes: Record<TRelicQuality, string> = {
29 VPQ_BRONZE: "",
30 VPQ_SILVER: " [Flawless]",
31 VPQ_GOLD: " [Radiant]",
32 VPQ_PLATINUM: " [Exceptional]"
33 };
34
26 35 const getItemListsController: RequestHandler = (req, response) => {
27 36 const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en");
28 37 const res: Record<string, ListedItem[]> = {};
@@ -108,9 +117,22 @@ const getItemListsController: RequestHandler = (req, response) => {
108 117 name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
109 118 }
110 119 }
120 if (uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/") {
121 res.miscitems.push({
122 uniqueName: item.productCategory + ":" + uniqueName,
123 name: name
124 });
125 }
126 }
127 for (const [uniqueName, item] of Object.entries(ExportRelics)) {
111 128 res.miscitems.push({
112 uniqueName: item.productCategory + ":" + uniqueName,
113 name: name
129 uniqueName: "MiscItems:" + uniqueName,
130 name:
131 getString("/Lotus/Language/Relics/VoidProjectionName", lang)
132 .split("|ERA|")
133 .join(item.era)
134 .split("|CATEGORY|")
135 .join(item.category) + relicQualitySuffixes[item.quality]
114 136 });
115 137 }
116 138 for (const [uniqueName, item] of Object.entries(ExportGear)) {