From dd6ae8898fc4fc76d95e7b263a406a390882d850 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:14:19 -0700 Subject: [PATCH] chore(webui): move max rank button before detailed view link (#2384) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2384 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- static/webui/script.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 34b39060..9755f08e 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -651,6 +651,7 @@ function updateInventory() { { const td = document.createElement("td"); td.classList = "text-end text-nowrap"; + let maxXP = Math.pow(uniqueLevelCaps[item.ItemType] ?? 30, 2) * 1000; if ( category != "Suits" && @@ -663,7 +664,6 @@ function updateInventory() { ) { maxXP /= 2; } - let anyExaltedMissingXP = false; if (item.XP >= maxXP && item.ItemType in itemMap && "exalted" in itemMap[item.ItemType]) { for (const exaltedType of itemMap[item.ItemType].exalted) { @@ -677,13 +677,6 @@ function updateInventory() { } } } - - if (["Suits", "LongGuns", "Pistols", "Melee", "SpaceGuns", "SpaceMelee"].includes(category)) { - const a = document.createElement("a"); - a.href = "/webui/detailedView?productCategory=" + category + "&itemId=" + item.ItemId.$oid; - a.innerHTML = ``; - td.appendChild(a); - } if (item.XP < maxXP || anyExaltedMissingXP) { const a = document.createElement("a"); a.href = "#"; @@ -721,6 +714,14 @@ function updateInventory() { a.innerHTML = ``; td.appendChild(a); } + + if (["Suits", "LongGuns", "Pistols", "Melee", "SpaceGuns", "SpaceMelee"].includes(category)) { + const a = document.createElement("a"); + a.href = "/webui/detailedView?productCategory=" + category + "&itemId=" + item.ItemId.$oid; + a.innerHTML = ``; + td.appendChild(a); + } + if (!(item.Features & 8) && modularWeapons.includes(item.ItemType)) { const a = document.createElement("a"); a.href = "#";