chore(webui): provide "max rank" option when only exalted needs it
All checks were successful
Build / build (push) Successful in 45s
Build / build (pull_request) Successful in 1m28s

This commit is contained in:
Sainan 2025-04-22 00:27:29 +02:00
parent a49edefbd1
commit 1276693497

View File

@ -443,12 +443,28 @@ function updateInventory() {
maxXP /= 2; maxXP /= 2;
} }
if (item.XP < maxXP) { let anyExaltedMissingXP = false;
if (item.XP >= maxXP && "exalted" in itemMap[item.ItemType]) {
for (const exaltedType of itemMap[item.ItemType].exalted) {
const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType);
if (exaltedItem) {
const exaltedCap = itemMap[exaltedType]?.type == "weapons" ? 800_000 : 1_600_000;
if (exaltedItem.XP < exaltedCap) {
anyExaltedMissingXP = true;
break;
}
}
}
}
if (item.XP < maxXP || anyExaltedMissingXP) {
const a = document.createElement("a"); const a = document.createElement("a");
a.href = "#"; a.href = "#";
a.onclick = function (event) { a.onclick = function (event) {
event.preventDefault(); event.preventDefault();
if (item.XP < maxXP) {
addGearExp(category, item.ItemId.$oid, maxXP - item.XP); addGearExp(category, item.ItemId.$oid, maxXP - item.XP);
}
if ("exalted" in itemMap[item.ItemType]) { if ("exalted" in itemMap[item.ItemType]) {
for (const exaltedType of itemMap[item.ItemType].exalted) { for (const exaltedType of itemMap[item.ItemType].exalted) {
const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType); const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType);