From e3b6accb5df9ea023a3a6c57681e2f284b1b9418 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:40:21 -0700 Subject: [PATCH] feat(webui): ship decorations (#2780) Re #2361 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2780 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> --- config-vanilla.json | 1 - src/controllers/api/inventoryController.ts | 11 +-- .../custom/getItemListsController.ts | 11 ++- src/services/configService.ts | 6 +- src/services/shipCustomizationsService.ts | 39 +++++------ static/webui/index.html | 25 +++++-- static/webui/script.js | 68 +++++++++++++++++-- static/webui/translations/de.js | 3 +- static/webui/translations/en.js | 3 +- static/webui/translations/es.js | 3 +- static/webui/translations/fr.js | 3 +- static/webui/translations/ru.js | 3 +- static/webui/translations/uk.js | 3 +- static/webui/translations/zh.js | 3 +- 14 files changed, 124 insertions(+), 58 deletions(-) diff --git a/config-vanilla.json b/config-vanilla.json index 56f93879..887a2141 100644 --- a/config-vanilla.json +++ b/config-vanilla.json @@ -11,7 +11,6 @@ "administratorNames": [], "autoCreateAccount": true, "skipTutorial": false, - "unlockAllShipDecorations": false, "unlockAllSkins": false, "fullyStockedVendors": false, "skipClanKeyCrafting": false, diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index f131c3f0..f4a9cfb1 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -10,7 +10,7 @@ import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts"; import type { IPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts"; import { ArtifactPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts"; import type { ICountedItem } from "warframe-public-export-plus"; -import { ExportCustoms, ExportResources } from "warframe-public-export-plus"; +import { ExportCustoms } from "warframe-public-export-plus"; import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "../../services/infestedFoundryService.ts"; import { addEmailItem, @@ -321,15 +321,6 @@ export const getInventoryResponse = async ( } } - if (config.unlockAllShipDecorations) { - inventoryResponse.ShipDecorations = []; - for (const [uniqueName, item] of Object.entries(ExportResources)) { - if (item.productCategory == "ShipDecorations") { - inventoryResponse.ShipDecorations.push({ ItemType: uniqueName, ItemCount: 999_999 }); - } - } - } - if (config.worldState?.baroTennoConRelay) { [ "/Lotus/Types/Items/Events/TennoConRelay2022EarlyAccess", diff --git a/src/controllers/custom/getItemListsController.ts b/src/controllers/custom/getItemListsController.ts index 3296ad1c..4088f8a1 100644 --- a/src/controllers/custom/getItemListsController.ts +++ b/src/controllers/custom/getItemListsController.ts @@ -64,6 +64,7 @@ interface ItemLists { TechProjects: ListedItem[]; VaultDecoRecipes: ListedItem[]; FlavourItems: ListedItem[]; + ShipDecorations: ListedItem[]; //circuitGameModes: ListedItem[]; } @@ -105,7 +106,8 @@ const getItemListsController: RequestHandler = (req, response) => { Abilities: [], TechProjects: [], VaultDecoRecipes: [], - FlavourItems: [] + FlavourItems: [], + ShipDecorations: [] /*circuitGameModes: [ { uniqueName: "Survival", @@ -233,7 +235,12 @@ const getItemListsController: RequestHandler = (req, response) => { } } } - if ( + if (item.productCategory == "ShipDecorations") { + res.ShipDecorations.push({ + uniqueName: uniqueName, + name: name + }); + } else if ( name && uniqueName.substring(0, 30) != "/Lotus/Types/Game/Projections/" && uniqueName != "/Lotus/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle" diff --git a/src/services/configService.ts b/src/services/configService.ts index 18348357..238cb368 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -21,7 +21,6 @@ export interface IConfig { administratorNames?: string[]; autoCreateAccount?: boolean; skipTutorial?: boolean; - unlockAllShipDecorations?: boolean; unlockAllSkins?: boolean; fullyStockedVendors?: boolean; skipClanKeyCrafting?: boolean; @@ -127,8 +126,9 @@ export const configRemovedOptionsKeys = [ "noDojoResearchCosts", "noDojoResearchTime", "fastClanAscension", - "unlockAllDecoRecipes", - "unlockAllFlavourItems" + "unlockAllFlavourItems", + "unlockAllShipDecorations", + "unlockAllDecoRecipes" ]; export const configPath = path.join(repoDir, args.configPath ?? "config.json"); diff --git a/src/services/shipCustomizationsService.ts b/src/services/shipCustomizationsService.ts index 2358fe41..073b6156 100644 --- a/src/services/shipCustomizationsService.ts +++ b/src/services/shipCustomizationsService.ts @@ -14,7 +14,6 @@ import type { import { logger } from "../utils/logger.ts"; import { Types } from "mongoose"; import { addFusionTreasures, addShipDecorations, getInventory } from "./inventoryService.ts"; -import { config } from "./configService.ts"; import { Guild } from "../models/guildModel.ts"; import { hasGuildPermission } from "./guildService.ts"; import { GuildPermission } from "../types/guildTypes.ts"; @@ -137,15 +136,13 @@ export const handleSetShipDecorations = async ( roomToPlaceIn.MaxCapacity += meta.capacityCost; await personalRooms.save(); - if (!config.unlockAllShipDecorations) { - const inventory = await getInventory(accountId); - if (deco.Sockets !== undefined) { - addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: deco.Sockets, ItemCount: 1 }]); - } else { - addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: 1 }]); - } - await inventory.save(); + const inventory = await getInventory(accountId); + if (deco.Sockets !== undefined) { + addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: deco.Sockets, ItemCount: 1 }]); + } else { + addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: 1 }]); } + await inventory.save(); return { DecoId: placedDecoration.RemoveId, @@ -155,15 +152,13 @@ export const handleSetShipDecorations = async ( }; } - if (!config.unlockAllShipDecorations) { - const inventory = await getInventory(accountId); - if (placedDecoration.Sockets !== undefined) { - addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: placedDecoration.Sockets, ItemCount: -1 }]); - } else { - addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: -1 }]); - } - await inventory.save(); + const inventory = await getInventory(accountId); + if (placedDecoration.Sockets !== undefined) { + addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: placedDecoration.Sockets, ItemCount: -1 }]); + } else { + addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: -1 }]); } + await inventory.save(); //place decoration const decoId = new Types.ObjectId(); @@ -221,12 +216,10 @@ export const handleResetShipDecorations = async ( } // refund item - if (!config.unlockAllShipDecorations) { - if (deco.Sockets !== undefined) { - addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: deco.Sockets, ItemCount: 1 }]); - } else { - addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: 1 }]); - } + if (deco.Sockets !== undefined) { + addFusionTreasures(inventory, [{ ItemType: itemType, Sockets: deco.Sockets, ItemCount: 1 }]); + } else { + addShipDecorations(inventory, [{ ItemType: itemType, ItemCount: 1 }]); } // refund capacity diff --git a/static/webui/index.html b/static/webui/index.html index a3449f8a..3e9713ce 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -108,9 +108,9 @@