feat: exalted weapons on webui #644
@ -1,10 +1,11 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getDict, getItemName, getString } from "@/src/services/itemDataService";
|
import { getDict, getExalted, getItemName, getString } from "@/src/services/itemDataService";
|
||||||
import {
|
import {
|
||||||
ExportArcanes,
|
ExportArcanes,
|
||||||
ExportGear,
|
ExportGear,
|
||||||
ExportRecipes,
|
ExportRecipes,
|
||||||
ExportResources,
|
ExportResources,
|
||||||
|
ExportSentinels,
|
||||||
ExportUpgrades,
|
ExportUpgrades,
|
||||||
ExportWarframes,
|
ExportWarframes,
|
||||||
ExportWeapons
|
ExportWeapons
|
||||||
@ -15,12 +16,34 @@ interface ListedItem {
|
|||||||
uniqueName: string;
|
uniqueName: string;
|
||||||
name: string;
|
name: string;
|
||||||
fusionLimit?: number;
|
fusionLimit?: number;
|
||||||
|
exalted?: { uniqueName: string; name: string }[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const getItemListsController: RequestHandler = (req, res) => {
|
const getItemListsController: RequestHandler = (req, res) => {
|
||||||
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 weapons = [];
|
const weapons = [];
|
||||||
const miscitems = [];
|
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)) {
|
for (const [uniqueName, item] of Object.entries(ExportWeapons)) {
|
||||||
if (item.productCategory !== "OperatorAmps") {
|
if (item.productCategory !== "OperatorAmps") {
|
||||||
if (item.totalDamage !== 0) {
|
if (item.totalDamage !== 0) {
|
||||||
@ -84,14 +107,7 @@ const getItemListsController: RequestHandler = (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
warframes: Object.entries(ExportWarframes)
|
warframes,
|
||||||
.filter(([_uniqueName, warframe]) => warframe.productCategory == "Suits")
|
|
||||||
.map(([uniqueName, warframe]) => {
|
|
||||||
return {
|
|
||||||
uniqueName,
|
|
||||||
name: getString(warframe.name, lang)
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
weapons,
|
weapons,
|
||||||
miscitems,
|
miscitems,
|
||||||
mods,
|
mods,
|
||||||
|
@ -2,7 +2,8 @@ import { isString } from "@/src/helpers/general";
|
|||||||
|
|
||||||
export enum ItemType {
|
export enum ItemType {
|
||||||
Powersuit = "Powersuit",
|
Powersuit = "Powersuit",
|
||||||
Weapon = "Weapon"
|
Weapon = "Weapon",
|
||||||
|
SpecialItem = "SpecialItem"
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isItemType = (itemType: string): itemType is ItemType => {
|
export const isItemType = (itemType: string): itemType is ItemType => {
|
||||||
|
@ -126,6 +126,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="powersuit-route" data-route="~ /webui/powersuit/(.+)" data-title="Inventory | OpenWF WebUI">
|
<div id="powersuit-route" data-route="~ /webui/powersuit/(.+)" data-title="Inventory | OpenWF WebUI">
|
||||||
|
<p class="mb-4">
|
||||||
|
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.
|
||||||
|
</p>
|
||||||
<h3 class="mb-0"></h3>
|
<h3 class="mb-0"></h3>
|
||||||
<p class="text-body-secondary"></p>
|
<p class="text-body-secondary"></p>
|
||||||
<div class="card mb-4">
|
<div class="card mb-4">
|
||||||
@ -143,6 +147,14 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card mb-4">
|
||||||
|
<h5 class="card-header">Exalted Weapons</h5>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table table-hover w-100">
|
||||||
|
<tbody id="exalted-list"></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-route="/webui/mods" data-title="Mods | OpenWF WebUI">
|
<div data-route="/webui/mods" data-title="Mods | OpenWF WebUI">
|
||||||
<p class="mb-4">
|
<p class="mb-4">
|
||||||
|
@ -449,6 +449,74 @@ function updateInventory() {
|
|||||||
$("#powersuit-route .text-body-secondary").text("");
|
$("#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 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>`;
|
||||||
|
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 = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 80V229.5c0 17 6.7 33.3 18.7 45.3l176 176c25 25 65.5 25 90.5 0L418.7 317.3c25-25 25-65.5 0-90.5l-176-176c-12-12-28.3-18.7-45.3-18.7H48C21.5 32 0 53.5 0 80zm112 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>`;
|
||||||
|
td.appendChild(a);
|
||||||
|
}
|
||||||
|
tr.appendChild(td);
|
||||||
|
}
|
||||||
|
document.getElementById("exalted-list").appendChild(tr);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
document.getElementById("exalted-list").closest(".card").style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
const uniqueUpgrades = {};
|
const uniqueUpgrades = {};
|
||||||
(item.ArchonCrystalUpgrades ?? []).forEach(upgrade => {
|
(item.ArchonCrystalUpgrades ?? []).forEach(upgrade => {
|
||||||
uniqueUpgrades[upgrade.UpgradeType] ??= 0;
|
uniqueUpgrades[upgrade.UpgradeType] ??= 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user