From c7703aad59af059fe9368f71dfc05706c66b0f4d Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 23:24:22 +0200 Subject: [PATCH 1/7] fix(webui): incorrect datalist for weapon-to-acquire --- static/webui/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/webui/index.html b/static/webui/index.html index ea91f01b..f38db36f 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -50,7 +50,7 @@
- +
-- 2.47.2 From e6adfcd53781d10ccf962dd9034f6d1be7c6e991 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 23:25:02 +0200 Subject: [PATCH 2/7] improve(webui): handle ItemType not being in itemMap --- static/webui/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 0a3de30c..9e8fed11 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -69,7 +69,7 @@ function updateInventory() { const tr = document.createElement("tr"); { const td = document.createElement("td"); - td.textContent = itemMap[item.ItemType].name; + td.textContent = itemMap[item.ItemType]?.name ?? item.ItemType; tr.appendChild(td); } { @@ -105,7 +105,7 @@ function updateInventory() { const tr = document.createElement("tr"); { const td = document.createElement("td"); - td.textContent = itemMap[item.ItemType].name; + td.textContent = itemMap[item.ItemType]?.name ?? item.ItemType; tr.appendChild(td); } { -- 2.47.2 From b9e5465f6328752883d2623e8e59ace8784a8a01 Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 23:38:04 +0200 Subject: [PATCH 3/7] fix(webui): "Make Rank 30" option not having onclick handler --- static/webui/script.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 9e8fed11..7fd9214d 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -83,7 +83,10 @@ function updateInventory() { }; a.textContent = "Make Rank 30"; td.appendChild(a); - td.innerHTML += " · "; + + const span = document.createElement("span"); + span.innerHTML = " · "; + td.appendChild(span); } { const a = document.createElement("a"); @@ -119,7 +122,10 @@ function updateInventory() { }; a.textContent = "Make Rank 30"; td.appendChild(a); - td.innerHTML += " · "; + + const span = document.createElement("span"); + span.innerHTML = " · "; + td.appendChild(span); } { const a = document.createElement("a"); -- 2.47.2 From c0fb637731684a644fd153875affbd4ecf492c8d Mon Sep 17 00:00:00 2001 From: Sainan Date: Mon, 6 May 2024 23:40:35 +0200 Subject: [PATCH 4/7] fix(webui): scroll position being reset when clicking on item options --- static/webui/script.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index 7fd9214d..c7a0cdc0 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -78,7 +78,8 @@ function updateInventory() { if (item.XP < 1_600_000) { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); addGearExp("Suits", item.ItemId.$oid, 1_600_000 - item.XP); }; a.textContent = "Make Rank 30"; @@ -91,7 +92,8 @@ function updateInventory() { { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); disposeOfGear("Suits", item.ItemId.$oid); }; a.textContent = "Remove"; @@ -117,7 +119,8 @@ function updateInventory() { if (item.XP < 800_000) { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); addGearExp(category, item.ItemId.$oid, 800_000 - item.XP); }; a.textContent = "Make Rank 30"; @@ -130,7 +133,8 @@ function updateInventory() { { const a = document.createElement("a"); a.href = "#"; - a.onclick = function () { + a.onclick = function (event) { + event.preventDefault(); disposeOfGear(category, item.ItemId.$oid); }; a.textContent = "Remove"; -- 2.47.2 From a6bc135ab89de59c7c656c6629933f2fcbf89cd8 Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 7 May 2024 11:55:16 +0200 Subject: [PATCH 5/7] improve(webui): re-add tip about visting navigation to update inventory --- static/webui/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/static/webui/index.html b/static/webui/index.html index f38db36f..5ab8a88a 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -26,6 +26,7 @@

Hello, ! Logout

+

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.

-- 2.47.2 From 2130a5fbdd0455b4f600b0e67dc622578ebf2cb3 Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 7 May 2024 09:55:38 +0000 Subject: [PATCH 6/7] Apply prettier changes --- static/webui/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/webui/index.html b/static/webui/index.html index 5ab8a88a..780792ec 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -26,7 +26,10 @@

Hello, ! Logout

-

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.

+

+ 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. +

-- 2.47.2 From 290e83e1393cf5b35960e852578d894d700ccfba Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 7 May 2024 16:31:40 +0200 Subject: [PATCH 7/7] fix: WebUI offering to add amps, which would fail --- src/controllers/custom/getItemListsController.ts | 2 +- src/services/inventoryService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index 92eedda0..ec768b83 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -18,7 +18,7 @@ function reduceItems(items: MinItem[]): ListedItem[] { const getItemListsController: RequestHandler = (_req, res) => { res.json({ warframes: reduceItems(warframes), - weapons: reduceItems(weapons) + weapons: reduceItems(weapons.filter(item => item.productCategory != "OperatorAmps")) }); }; diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 43675663..d199ccb4 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -178,7 +178,7 @@ export const addWeapon = async ( weaponIndex = inventory.Melee.push({ ItemType: weaponName, Configs: [], XP: 0 }); break; default: - throw new Error("unknown weapon type"); + throw new Error("unknown weapon type: " + weaponType); } const changedInventory = await inventory.save(); -- 2.47.2