diff --git a/config.json.example b/config.json.example index e874d450..9b46d49f 100644 --- a/config.json.example +++ b/config.json.example @@ -16,6 +16,7 @@ "unlockAllQuests": true, "completeAllQuests": false, "infiniteResources": true, + "infinitePlatinum": true, "unlockAllShipFeatures": true, "unlockAllShipDecorations": true, "unlockAllFlavourItems": true, diff --git a/src/controllers/api/getCreditsController.ts b/src/controllers/api/getCreditsController.ts index 805b0505..ae7d06e5 100644 --- a/src/controllers/api/getCreditsController.ts +++ b/src/controllers/api/getCreditsController.ts @@ -22,8 +22,18 @@ export const getCreditsController: RequestHandler = async (req, res) => { }); return; } - - const inventory = await getInventory(accountId); + + const inventory = await getInventory(accountId); + if (config.infinitePlatinum) { + res.json({ + RegularCredits: inventory.RegularCredits, + TradesRemaining: inventory.TradesRemaining, + PremiumCreditsFree: 999999999, + PremiumCredits: 999999999 + }); + return; + } + res.json({ RegularCredits: inventory.RegularCredits, TradesRemaining: inventory.TradesRemaining, diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 03383df8..cfbecf32 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -42,6 +42,11 @@ const inventoryController: RequestHandler = async (request, response) => { inventoryResponse.PremiumCredits = 999999999; } + if (config.infinitePlatinum) { + inventoryResponse.PremiumCreditsFree = 999999999; + inventoryResponse.PremiumCredits = 999999999; + } + if (config.unlockAllMissions) { inventoryResponse.Missions = allMissions; inventoryResponse.NodeIntrosCompleted.push("TeshinHardModeUnlocked"); diff --git a/src/routes/custom.ts b/src/routes/custom.ts index 476c5997..6c0a7416 100644 --- a/src/routes/custom.ts +++ b/src/routes/custom.ts @@ -15,4 +15,4 @@ customRouter.post("/addItem", addItemController); customRouter.get("/config", getConfigDataController); customRouter.post("/config", updateConfigDataController); -export { customRouter }; +export { customRouter }; \ No newline at end of file diff --git a/src/services/configService.ts b/src/services/configService.ts index 785c0f0b..ee727cb6 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -33,6 +33,7 @@ interface IConfig { unlockAllQuests?: boolean; completeAllQuests?: boolean; infiniteResources?: boolean; + infinitePlatinum?: boolean; unlockAllShipFeatures?: boolean; unlockAllShipDecorations?: boolean; unlockAllFlavourItems?: boolean; diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 12e1fbca..2e98be41 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -339,7 +339,9 @@ export const updateCurrency = async (price: number, usePremium: boolean, account const inventory = await getInventory(accountId); if (usePremium) { - if (inventory.PremiumCreditsFree > 0) { + if (config.infinitePlatinum) { + return {}; + } else if (inventory.PremiumCreditsFree > 0) { inventory.PremiumCreditsFree -= Math.min(price, inventory.PremiumCreditsFree); } inventory.PremiumCredits -= price; diff --git a/static/webui/index.html b/static/webui/index.html index d19f125a..57cdbd84 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -231,9 +231,11 @@
- + +
+
+ +
@@ -241,9 +243,7 @@
- +
@@ -254,9 +254,7 @@
- +