feat(webui): acquire flawed mods & imposters via add mods
All checks were successful
Build / build (22) (push) Successful in 37s
Build / build (20) (push) Successful in 47s
Build / build (18) (push) Successful in 57s
Build / build (18) (pull_request) Successful in 39s
Build / build (20) (pull_request) Successful in 49s
Build / build (22) (pull_request) Successful in 36s

This commit is contained in:
Sainan 2025-02-27 02:21:08 +01:00
parent ca55b21a2a
commit adc77bbf93
3 changed files with 24 additions and 13 deletions

View File

@ -20,6 +20,7 @@ interface ListedItem {
name: string;
fusionLimit?: number;
exalted?: string[];
badReason?: "starter" | "frivolous" | "notraw";
}
const getItemListsController: RequestHandler = (req, response) => {
@ -132,16 +133,20 @@ const getItemListsController: RequestHandler = (req, response) => {
}
res.mods = [];
const badItems: Record<string, boolean> = {};
for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
res.mods.push({
const mod: ListedItem = {
uniqueName,
name: getString(upgrade.name, lang),
fusionLimit: upgrade.fusionLimit
});
if (upgrade.isStarter || upgrade.isFrivolous || upgrade.upgradeEntries) {
badItems[uniqueName] = true;
};
if (upgrade.isStarter) {
mod.badReason = "starter";
} else if (upgrade.isFrivolous) {
mod.badReason = "frivolous";
} else if (upgrade.upgradeEntries) {
mod.badReason = "notraw";
}
res.mods.push(mod);
}
for (const [uniqueName, upgrade] of Object.entries(ExportAvionics)) {
res.mods.push({
@ -151,13 +156,14 @@ const getItemListsController: RequestHandler = (req, response) => {
});
}
for (const [uniqueName, arcane] of Object.entries(ExportArcanes)) {
res.mods.push({
const mod: ListedItem = {
uniqueName,
name: getString(arcane.name, lang)
});
};
if (arcane.isFrivolous) {
badItems[uniqueName] = true;
mod.badReason = "frivolous";
}
res.mods.push(mod);
}
for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
res.Syndicates.push({
@ -167,7 +173,6 @@ const getItemListsController: RequestHandler = (req, response) => {
}
response.json({
badItems,
archonCrystalUpgrades,
uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
...res

View File

@ -207,11 +207,16 @@ function fetchItemList() {
document.getElementById("changeSyndicate").appendChild(option);
itemMap[item.uniqueName] = { ...item, type };
});
} else if (type != "badItems") {
} else {
items.forEach(item => {
if (item.uniqueName in data.badItems) {
item.name += " " + loc("code_badItem");
} else if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/") {
if ("badReason" in item) {
if (item.badReason == "starter") {
item.name = loc("code_starter").split("|MOD|").join(item.name);
} else {
item.name += " " + loc("code_badItem");
}
}
if (item.uniqueName.substr(0, 18) != "/Lotus/Types/Game/" && item.badReason != "notraw") {
const option = document.createElement("option");
option.setAttribute("data-key", item.uniqueName);
option.value = item.name;

View File

@ -18,6 +18,7 @@ dict = {
code_kDrive: `K-Drive`,
code_legendaryCore: `Legendary Core`,
code_traumaticPeculiar: `Traumatic Peculiar`,
code_starter: `|MOD| (Flawed)`,
code_badItem: `(Imposter)`,
code_maxRank: `Max Rank`,
code_rename: `Rename`,