From 07ad3980d1a03990c6a12bb500dc9a758f19904a Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:19:11 +0200 Subject: [PATCH 1/2] remove superfluous escaping --- static/webui/translations/de.js | 2 +- static/webui/translations/en.js | 2 +- static/webui/translations/fr.js | 2 +- static/webui/translations/ru.js | 2 +- static/webui/translations/zh.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index a4771cf3..10da9e23 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -139,7 +139,7 @@ dict = { cheats_dontSubtractConsumables: `Verbrauchsgegenstände (Ausrüstung) nicht verbrauchen`, cheats_unlockAllShipFeatures: `Alle Schiffs-Funktionen freischalten`, cheats_unlockAllShipDecorations: `Alle Schiffsdekorationen freischalten`, - cheats_unlockAllFlavourItems: `Alle Sammlerstücke freischalten`, + cheats_unlockAllFlavourItems: `Alle Sammlerstücke freischalten`, cheats_unlockAllSkins: `Alle Skins freischalten`, cheats_unlockAllCapturaScenes: `Alle Photora-Szenen freischalten`, cheats_unlockAllDecoRecipes: `Alle Dojo-Deko-Baupläne freischalten`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index f17c2e0a..bbe3160b 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -138,7 +138,7 @@ dict = { cheats_dontSubtractConsumables: `Don't Subtract Consumables`, cheats_unlockAllShipFeatures: `Unlock All Ship Features`, cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`, - cheats_unlockAllFlavourItems: `Unlock All Flavor Items`, + cheats_unlockAllFlavourItems: `Unlock All Flavor Items`, cheats_unlockAllSkins: `Unlock All Skins`, cheats_unlockAllCapturaScenes: `Unlock All Captura Scenes`, cheats_unlockAllDecoRecipes: `Unlock All Dojo Deco Recipes`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index e4c99dd6..7729b2d3 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -139,7 +139,7 @@ dict = { cheats_dontSubtractConsumables: `Ne pas retirer de consommables`, cheats_unlockAllShipFeatures: `Débloquer tous les segments du vaisseau`, cheats_unlockAllShipDecorations: `Débloquer toutes les décorations du vaisseau`, - cheats_unlockAllFlavourItems: `Débloquer tous les Flavor Items`, + cheats_unlockAllFlavourItems: `Débloquer tous les Flavor Items`, cheats_unlockAllSkins: `Débloquer tous les skins`, cheats_unlockAllCapturaScenes: `Débloquer toutes les scènes captura`, cheats_unlockAllDecoRecipes: `Débloquer toutes les recherches dojo`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index e0247b7e..992c4d62 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -139,7 +139,7 @@ dict = { cheats_dontSubtractConsumables: `Не уменьшать количество расходников`, cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`, cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`, - cheats_unlockAllFlavourItems: `Разблокировать все уникальные предметы`, + cheats_unlockAllFlavourItems: `Разблокировать все уникальные предметы`, cheats_unlockAllSkins: `Разблокировать все скины`, cheats_unlockAllCapturaScenes: `Разблокировать все сцены Каптуры`, cheats_unlockAllDecoRecipes: `Разблокировать все рецепты декораций Дoдзё`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 22bc33f9..88ee8e5d 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -139,7 +139,7 @@ dict = { cheats_dontSubtractConsumables: `消耗物品使用时无损耗`, cheats_unlockAllShipFeatures: `解锁所有飞船功能`, cheats_unlockAllShipDecorations: `解锁所有飞船装饰`, - cheats_unlockAllFlavourItems: `解锁所有装饰物品`, + cheats_unlockAllFlavourItems: `解锁所有装饰物品`, cheats_unlockAllSkins: `解锁所有外观`, cheats_unlockAllCapturaScenes: `解锁所有Captura场景`, cheats_unlockAllDecoRecipes: `解锁所有道场配方`, -- 2.47.2 From 336998c9eec94674364bb37d1b178e9c43d24494 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:21:44 +0200 Subject: [PATCH 2/2] feat: dontSubtractVendor{Credit,Platinum,Item,Standing}Cost cheats --- config.json.example | 4 ++ src/services/configService.ts | 4 ++ src/services/purchaseService.ts | 90 +++++++++++++++++++-------------- static/webui/index.html | 20 +++++++- static/webui/translations/de.js | 4 ++ static/webui/translations/en.js | 4 ++ static/webui/translations/es.js | 4 ++ static/webui/translations/fr.js | 4 ++ static/webui/translations/ru.js | 4 ++ static/webui/translations/zh.js | 4 ++ 10 files changed, 101 insertions(+), 41 deletions(-) diff --git a/config.json.example b/config.json.example index 8f839751..ecae09aa 100644 --- a/config.json.example +++ b/config.json.example @@ -20,6 +20,10 @@ "infiniteRegalAya": false, "infiniteHelminthMaterials": false, "claimingBlueprintRefundsIngredients": false, + "dontSubtractPurchaseCreditCost": false, + "dontSubtractPurchasePlatinumCost": false, + "dontSubtractPurchaseItemCost": false, + "dontSubtractPurchaseStandingCost": false, "dontSubtractVoidTraces": false, "dontSubtractConsumables": false, "unlockAllShipFeatures": false, diff --git a/src/services/configService.ts b/src/services/configService.ts index 0c09eb23..6dde7d53 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -25,6 +25,10 @@ export interface IConfig { infiniteRegalAya?: boolean; infiniteHelminthMaterials?: boolean; claimingBlueprintRefundsIngredients?: boolean; + dontSubtractPurchaseCreditCost?: boolean; + dontSubtractPurchasePlatinumCost?: boolean; + dontSubtractPurchaseItemCost?: boolean; + dontSubtractPurchaseStandingCost?: boolean; dontSubtractVoidTraces?: boolean; dontSubtractConsumables?: boolean; unlockAllShipFeatures?: boolean; diff --git a/src/services/purchaseService.ts b/src/services/purchaseService.ts index 59a431c3..4fb5bb2d 100644 --- a/src/services/purchaseService.ts +++ b/src/services/purchaseService.ts @@ -67,25 +67,31 @@ export const handlePurchase = async ( if (!offer) { throw new Error(`unknown vendor offer: ${ItemId ? ItemId : purchaseRequest.PurchaseParams.StoreItem}`); } - if (offer.RegularPrice) { - combineInventoryChanges( - prePurchaseInventoryChanges, - updateCurrency(inventory, offer.RegularPrice[0], false) - ); + if (!config.dontSubtractPurchaseCreditCost) { + if (offer.RegularPrice) { + combineInventoryChanges( + prePurchaseInventoryChanges, + updateCurrency(inventory, offer.RegularPrice[0], false) + ); + } } - if (offer.PremiumPrice) { - combineInventoryChanges( - prePurchaseInventoryChanges, - updateCurrency(inventory, offer.PremiumPrice[0], true) - ); + if (!config.dontSubtractPurchasePlatinumCost) { + if (offer.PremiumPrice) { + combineInventoryChanges( + prePurchaseInventoryChanges, + updateCurrency(inventory, offer.PremiumPrice[0], true) + ); + } } - if (offer.ItemPrices) { - handleItemPrices( - inventory, - offer.ItemPrices, - purchaseRequest.PurchaseParams.Quantity, - prePurchaseInventoryChanges - ); + if (!config.dontSubtractPurchaseItemCost) { + if (offer.ItemPrices) { + handleItemPrices( + inventory, + offer.ItemPrices, + purchaseRequest.PurchaseParams.Quantity, + prePurchaseInventoryChanges + ); + } } if (offer.LocTagRandSeed !== undefined) { seed = BigInt(offer.LocTagRandSeed); @@ -179,21 +185,25 @@ export const handlePurchase = async ( x => x.ItemType == purchaseRequest.PurchaseParams.StoreItem ); if (offer) { - combineInventoryChanges( - purchaseResponse.InventoryChanges, - updateCurrency(inventory, offer.RegularPrice, false) - ); + if (!config.dontSubtractPurchaseCreditCost) { + combineInventoryChanges( + purchaseResponse.InventoryChanges, + updateCurrency(inventory, offer.RegularPrice, false) + ); + } if (purchaseRequest.PurchaseParams.ExpectedPrice) { throw new Error(`vendor purchase should not have an expected price`); } - const invItem: IMiscItem = { - ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks", - ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1 - }; - addMiscItems(inventory, [invItem]); - purchaseResponse.InventoryChanges.MiscItems ??= []; - purchaseResponse.InventoryChanges.MiscItems.push(invItem); + if (!config.dontSubtractPurchaseItemCost) { + const invItem: IMiscItem = { + ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks", + ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1 + }; + addMiscItems(inventory, [invItem]); + purchaseResponse.InventoryChanges.MiscItems ??= []; + purchaseResponse.InventoryChanges.MiscItems.push(invItem); + } } break; } @@ -211,7 +221,7 @@ export const handlePurchase = async ( Title: lastTitle } ]; - } else { + } else if (!config.dontSubtractPurchaseStandingCost) { const syndicate = ExportSyndicates[syndicateTag]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (syndicate) { @@ -239,19 +249,19 @@ export const handlePurchase = async ( const vendor = ExportVendors[purchaseRequest.PurchaseParams.SourceId!]; const offer = vendor.items.find(x => x.storeItem == purchaseRequest.PurchaseParams.StoreItem); if (offer) { - if (typeof offer.credits == "number") { + if (typeof offer.credits == "number" && !config.dontSubtractPurchaseCreditCost) { combineInventoryChanges( purchaseResponse.InventoryChanges, updateCurrency(inventory, offer.credits, false) ); } - if (typeof offer.platinum == "number") { + if (typeof offer.platinum == "number" && !config.dontSubtractPurchasePlatinumCost) { combineInventoryChanges( purchaseResponse.InventoryChanges, updateCurrency(inventory, offer.platinum, true) ); } - if (offer.itemPrices) { + if (offer.itemPrices && !config.dontSubtractPurchaseItemCost) { handleItemPrices( inventory, offer.itemPrices, @@ -278,15 +288,17 @@ export const handlePurchase = async ( ); if (offer) { if (offer.RegularPrice) { - const invItem: IMiscItem = { - ItemType: "/Lotus/Types/Items/MiscItems/SchismKey", - ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1 - }; + if (!config.dontSubtractPurchaseItemCost) { + const invItem: IMiscItem = { + ItemType: "/Lotus/Types/Items/MiscItems/SchismKey", + ItemCount: offer.RegularPrice * purchaseRequest.PurchaseParams.Quantity * -1 + }; - addMiscItems(inventory, [invItem]); + addMiscItems(inventory, [invItem]); - purchaseResponse.InventoryChanges.MiscItems ??= []; - purchaseResponse.InventoryChanges.MiscItems.push(invItem); + purchaseResponse.InventoryChanges.MiscItems ??= []; + purchaseResponse.InventoryChanges.MiscItems.push(invItem); + } } else if (!config.infiniteRegalAya) { inventory.PrimeTokens -= offer.PrimePrice! * purchaseRequest.PurchaseParams.Quantity; diff --git a/static/webui/index.html b/static/webui/index.html index 9b9015a2..b6d87db4 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -604,13 +604,29 @@ +