diff --git a/config.json.example b/config.json.example index d027f7cb..5fc5d6da 100644 --- a/config.json.example +++ b/config.json.example @@ -22,6 +22,7 @@ "unlockAllShipDecorations": true, "unlockAllFlavourItems": true, "unlockAllSkins": true, + "unlockAllCapturaScenes": true, "universalPolarityEverywhere": true, "spoofMasteryRank": -1 } diff --git a/package-lock.json b/package-lock.json index 6c646266..41a3bb15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "copyfiles": "^2.4.1", "express": "^5", "mongoose": "^8.9.2", - "warframe-public-export-plus": "^0.5.15", + "warframe-public-export-plus": "^0.5.16", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" @@ -3877,9 +3877,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.15", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.15.tgz", - "integrity": "sha512-xsMgj1+lB2VPDCLuU88YsbwQiGQT5cNgjgNTk1iKx2ZpX31fu19tflTWrTHEJbSnqxuh/8h2LP5ZpBZV0a9fCg==" + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.16.tgz", + "integrity": "sha512-4Mgng3ojWfF0mffZDKQLwrKx6qHty7o35F5+nCDmSal1TzjeEclJCSgoMgdAO0e+Ug/lTP7FSiIXcU4SDk3gsw==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 6f962ace..c518f347 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "copyfiles": "^2.4.1", "express": "^5", "mongoose": "^8.9.2", - "warframe-public-export-plus": "^0.5.15", + "warframe-public-export-plus": "^0.5.16", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index af6a420e..59b3af5c 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -7,9 +7,16 @@ import allDialogue from "@/static/fixed_responses/allDialogue.json"; import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes"; import { IShipInventory, equipmentKeys } from "@/src/types/inventoryTypes/inventoryTypes"; import { IPolarity, ArtifactPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes"; -import { ExportCustoms, ExportFlavour, ExportKeys, ExportRegions, ExportResources } from "warframe-public-export-plus"; +import { + ExportCustoms, + ExportFlavour, + ExportKeys, + ExportRegions, + ExportResources, + ExportVirtuals +} from "warframe-public-export-plus"; -const inventoryController: RequestHandler = async (request, response) => { +export const inventoryController: RequestHandler = async (request, response) => { let account; try { account = await getAccountForRequest(request); @@ -152,6 +159,17 @@ const inventoryController: RequestHandler = async (request, response) => { } } + if (config.unlockAllCapturaScenes) { + for (const uniqueName of Object.keys(ExportResources)) { + if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) { + inventoryResponse.MiscItems.push({ + ItemType: uniqueName, + ItemCount: 1 + }); + } + } + } + if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) { inventoryResponse.PlayerLevel = config.spoofMasteryRank; if (!("xpBasedLevelCapDisabled" in request.query)) { @@ -206,4 +224,19 @@ const getExpRequiredForMr = (rank: number): number => { return 2_250_000 + 147_500 * (rank - 30); }; -export { inventoryController }; +const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => { + let parentName = resourceGetParent(resourceName); + for (; parentName != undefined; parentName = resourceGetParent(parentName)) { + if (parentName == targetName) { + return true; + } + } + return false; +}; + +const resourceGetParent = (resourceName: string): string | undefined => { + if (resourceName in ExportResources) { + return ExportResources[resourceName].parentName; + } + return ExportVirtuals[resourceName]?.parentName; +}; diff --git a/src/services/configService.ts b/src/services/configService.ts index ecc6d359..7f55c320 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -47,6 +47,7 @@ interface IConfig { unlockAllShipDecorations?: boolean; unlockAllFlavourItems?: boolean; unlockAllSkins?: boolean; + unlockAllCapturaScenes?: boolean; universalPolarityEverywhere?: boolean; spoofMasteryRank?: number; } diff --git a/static/webui/index.html b/static/webui/index.html index 416d1978..984bdc7f 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -257,6 +257,10 @@ +