From ab326eedb6788271b897007188572a791d26bd34 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 5 Jan 2025 07:17:23 +0100 Subject: [PATCH 1/2] feat(webui): add "Fully Level Up Helminth" --- src/controllers/api/infestedFoundryController.ts | 13 +++++++++++++ static/webui/index.html | 3 ++- static/webui/script.js | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/infestedFoundryController.ts b/src/controllers/api/infestedFoundryController.ts index 4fa5f694..fcfe33ee 100644 --- a/src/controllers/api/infestedFoundryController.ts +++ b/src/controllers/api/infestedFoundryController.ts @@ -223,6 +223,19 @@ export const infestedFoundryController: RequestHandler = async (req, res) => { break; } + case "custom_unlockall": { + const inventory = await getInventory(accountId); + inventory.InfestedFoundry ??= {}; + inventory.InfestedFoundry.XP ??= 0; + if (151875_00 > inventory.InfestedFoundry.XP) { + const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry, 151875_00 - inventory.InfestedFoundry.XP) + addRecipes(inventory, recipeChanges); + await inventory.save(); + } + res.end(); + break; + } + default: throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`); } diff --git a/static/webui/index.html b/static/webui/index.html index af629d1f..e5c4eca8 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -278,7 +278,8 @@
Account
- +

+
diff --git a/static/webui/script.js b/static/webui/script.js index 160ccfae..fd7fdf15 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -955,6 +955,12 @@ function unlockFocusSchool(upgradeType) { }); } +function doHelminthUnlockAll() { + revalidateAuthz(() => { + $.post("/api/infestedFoundry.php?" + window.authz + "&mode=custom_unlockall"); + }); +} + // Powersuit Route single.getRoute("#powersuit-route").on("beforeload", function () { -- 2.47.2 From 9c09d4fb5c24db3f4b0435a55dede4fdef9802ed Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 5 Jan 2025 07:17:38 +0100 Subject: [PATCH 2/2] prettier --- src/controllers/api/infestedFoundryController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/infestedFoundryController.ts b/src/controllers/api/infestedFoundryController.ts index fcfe33ee..0f0833d6 100644 --- a/src/controllers/api/infestedFoundryController.ts +++ b/src/controllers/api/infestedFoundryController.ts @@ -228,7 +228,10 @@ export const infestedFoundryController: RequestHandler = async (req, res) => { inventory.InfestedFoundry ??= {}; inventory.InfestedFoundry.XP ??= 0; if (151875_00 > inventory.InfestedFoundry.XP) { - const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry, 151875_00 - inventory.InfestedFoundry.XP) + const recipeChanges = addInfestedFoundryXP( + inventory.InfestedFoundry, + 151875_00 - inventory.InfestedFoundry.XP + ); addRecipes(inventory, recipeChanges); await inventory.save(); } -- 2.47.2