diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index e3fa95a1..5db843f2 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -1,10 +1,11 @@ import { RequestHandler } from "express"; -import { getDict, getItemName, getString } from "@/src/services/itemDataService"; +import { getDict, getExalted, getItemName, getString } from "@/src/services/itemDataService"; import { ExportArcanes, ExportGear, ExportRecipes, ExportResources, + ExportSentinels, ExportUpgrades, ExportWarframes, ExportWeapons @@ -15,12 +16,34 @@ interface ListedItem { uniqueName: string; name: string; fusionLimit?: number; + exalted?: { uniqueName: string; name: string }[]; } const getItemListsController: RequestHandler = (req, res) => { const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en"); const weapons = []; const miscitems = []; + const warframes = []; + for (const [uniqueName, item] of Object.entries(ExportWarframes)) { + if (item.productCategory == "Suits") { + const warframe: ListedItem = { + uniqueName, + name: getString(item.name, lang) + }; + const exalted = getExalted(uniqueName); + if (exalted) { + warframe.exalted = []; + exalted.forEach(element => { + const exalted = ExportWeapons[element] || ExportSentinels[element]; + warframe.exalted?.push({ + uniqueName: element, + name: getString(exalted.name, lang) + }); + }); + } + warframes.push(warframe); + } + } for (const [uniqueName, item] of Object.entries(ExportWeapons)) { if (item.productCategory !== "OperatorAmps") { if (item.totalDamage !== 0) { @@ -84,14 +107,7 @@ const getItemListsController: RequestHandler = (req, res) => { } res.json({ - warframes: Object.entries(ExportWarframes) - .filter(([_uniqueName, warframe]) => warframe.productCategory == "Suits") - .map(([uniqueName, warframe]) => { - return { - uniqueName, - name: getString(warframe.name, lang) - }; - }), + warframes, weapons, miscitems, mods, diff --git a/src/helpers/customHelpers/addItemHelpers.ts b/src/helpers/customHelpers/addItemHelpers.ts index 5ce2378f..112fd2e6 100644 --- a/src/helpers/customHelpers/addItemHelpers.ts +++ b/src/helpers/customHelpers/addItemHelpers.ts @@ -2,7 +2,8 @@ import { isString } from "@/src/helpers/general"; export enum ItemType { Powersuit = "Powersuit", - Weapon = "Weapon" + Weapon = "Weapon", + SpecialItem = "SpecialItem" } export const isItemType = (itemType: string): itemType is ItemType => { diff --git a/static/webui/index.html b/static/webui/index.html index 416d1978..b99c3aae 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -126,6 +126,10 @@
+

+ Note: Changes made here will only be reflected in-game when the game re-downloads your + inventory. Visiting the navigation should be the easiest way to trigger that. +

@@ -143,6 +147,14 @@
+
+
Exalted Weapons
+
+ + +
+
+

diff --git a/static/webui/script.js b/static/webui/script.js index 56736c38..68ed9724 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -449,6 +449,74 @@ function updateInventory() { $("#powersuit-route .text-body-secondary").text(""); } + document.getElementById("exalted-list").innerHTML = ""; + document.getElementById("exalted-list").closest(".card").style = ""; + + const exaltedWeapons = itemMap[item.ItemType].exalted; + if (exaltedWeapons) { + const specialItems = exaltedWeapons + .map(element => { + const specialItem = data.SpecialItems.find(x => x.ItemType == element.uniqueName); + if (specialItem) { + return { + ...specialItem, + name: element.name + }; + } + return undefined; + }) + .filter(item => item !== undefined); + + specialItems.forEach(item => { + const tr = document.createElement("tr"); + { + const td = document.createElement("td"); + td.textContent = item?.name ?? item.ItemType; + if (item.ItemName) { + td.textContent = item.ItemName + " (" + td.textContent + ")"; + } + tr.appendChild(td); + } + { + const td = document.createElement("td"); + td.classList = "text-end"; + + const targetXP = item.ItemType.startsWith("/Lotus/Powersuits/Khora/Kavat/") + ? 900_000 + : 450_000; + if (item.XP < targetXP) { + const a = document.createElement("a"); + a.href = "#"; + a.onclick = function (event) { + event.preventDefault(); + addGearExp("SpecialItems", item.ItemId.$oid, targetXP - item.XP); + }; + a.title = "Make Rank 30"; + a.innerHTML = ``; + td.appendChild(a); + } + { + const a = document.createElement("a"); + a.href = "#"; + a.onclick = function (event) { + event.preventDefault(); + const name = prompt("Enter new custom name:"); + if (name !== null) { + renameGear("SpecialItems", item.ItemId.$oid, name); + } + }; + a.title = "Rename"; + a.innerHTML = ``; + td.appendChild(a); + } + tr.appendChild(td); + } + document.getElementById("exalted-list").appendChild(tr); + }); + } else { + document.getElementById("exalted-list").closest(".card").style.display = "none"; + } + const uniqueUpgrades = {}; (item.ArchonCrystalUpgrades ?? []).forEach(upgrade => { uniqueUpgrades[upgrade.UpgradeType] ??= 0;