返回提交历史
Modified
static/webui/script.js
+18
-2
XFEstudio/SpaceNinjaServer
chore(webui): provide "max rank" option when only exalted needs it (#1776)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1776 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
c4b8a71c
代码差异
1 个文件
+18
-2
@@ -443,12 +443,28 @@ function updateInventory() {
443
443
maxXP /= 2;
444
444
}
445
445
446
if (item.XP < maxXP) {
446
let anyExaltedMissingXP = false;
447
if (item.XP >= maxXP && "exalted" in itemMap[item.ItemType]) {
448
for (const exaltedType of itemMap[item.ItemType].exalted) {
449
const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType);
450
if (exaltedItem) {
451
const exaltedCap = itemMap[exaltedType]?.type == "weapons" ? 800_000 : 1_600_000;
452
if (exaltedItem.XP < exaltedCap) {
453
anyExaltedMissingXP = true;
454
break;
455
}
456
}
457
}
458
}
459
460
if (item.XP < maxXP || anyExaltedMissingXP) {
447
461
const a = document.createElement("a");
448
462
a.href = "#";
449
463
a.onclick = function (event) {
450
464
event.preventDefault();
451
addGearExp(category, item.ItemId.$oid, maxXP - item.XP);
465
if (item.XP < maxXP) {
466
addGearExp(category, item.ItemId.$oid, maxXP - item.XP);
467
}
452
468
if ("exalted" in itemMap[item.ItemType]) {
453
469
for (const exaltedType of itemMap[item.ItemType].exalted) {
454
470
const exaltedItem = data.SpecialItems.find(x => x.ItemType == exaltedType);