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 @@
-
+ - +
@@ -474,6 +474,21 @@
+
+
+
+
+
+ + + +
+ + +
+
+
+
@@ -486,6 +501,7 @@ +
@@ -996,10 +1012,6 @@
-
- - -
@@ -1401,6 +1413,7 @@ + diff --git a/static/webui/script.js b/static/webui/script.js index bd0107c2..168bc9cd 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -1043,6 +1043,40 @@ function updateInventory() { }; } + document.getElementById("ShipDecorations-list").innerHTML = ""; + data.ShipDecorations.forEach(item => { + if (item.ItemCount > 0) { + const tr = document.createElement("tr"); + tr.setAttribute("data-item-type", item.ItemType); + { + const td = document.createElement("td"); + td.textContent = itemMap[item.ItemType]?.name ?? item.ItemType; + if (item.ItemCount > 1) { + td.innerHTML += + " 🗍 " + parseInt(item.ItemCount) + ""; + } + tr.appendChild(td); + } + { + const td = document.createElement("td"); + td.classList = "text-end text-nowrap"; + { + const a = document.createElement("a"); + a.href = "#"; + a.onclick = function (event) { + event.preventDefault(); + removeCountItems(item.ItemType, item.ItemCount); + }; + a.title = loc("code_remove"); + a.innerHTML = ``; + td.appendChild(a); + } + tr.appendChild(td); + } + document.getElementById("ShipDecorations-list").appendChild(tr); + } + }); + // Populate quests route document.getElementById("QuestKeys-list").innerHTML = ""; window.allQuestKeys.forEach(questKey => { @@ -1304,7 +1338,8 @@ function updateInventory() { td.textContent = itemMap[item.ItemType]?.name ?? item.ItemType; td.innerHTML += " ★ 0/" + maxRank + ""; if (item.ItemCount > 1) { - td.innerHTML += " 🗍 " + parseInt(item.ItemCount) + ""; + td.innerHTML += + " 🗍 " + parseInt(item.ItemCount) + ""; } tr.appendChild(td); } @@ -2228,7 +2263,9 @@ function addMissingEquipment(categories) { ) ) { if (!webUiModularWeapons.includes(elm.getAttribute("data-key"))) { - requests.push({ ItemType: elm.getAttribute("data-key"), ItemCount: 1 }); + let ItemCount = 1; + if (category == "ShipDecorations") ItemCount = 100; + requests.push({ ItemType: elm.getAttribute("data-key"), ItemCount }); } } }); @@ -2748,13 +2785,13 @@ function setEvolutionProgress(requests) { }); } -function doAcquireMiscItems() { - const uniqueName = getKey(document.getElementById("miscitem-type")); +function doAcquireCountItems(category) { + const uniqueName = getKey(document.getElementById(category + "-type")); if (!uniqueName) { - $("#miscitem-type").addClass("is-invalid").focus(); + $(`#acquire-type-${category}`).addClass("is-invalid").focus(); return; } - const count = parseInt($("#miscitem-count").val()); + const count = parseInt($(`#${category}-count`).val()); if (count != 0) { revalidateAuthz().then(() => { $.post({ @@ -2772,11 +2809,30 @@ function doAcquireMiscItems() { } else { toast(loc("code_succRemoved")); } + if (category != "miscitem") updateInventory(); }); }); } } +function removeCountItems(uniqueName, count) { + revalidateAuthz().then(() => { + $.post({ + url: "/custom/addItems?" + window.authz, + contentType: "application/json", + data: JSON.stringify([ + { + ItemType: uniqueName, + ItemCount: count * -1 + } + ]) + }).done(function () { + toast(loc("code_succRemoved")); + updateInventory(); + }); + }); +} + function addItemByItemType() { const ItemType = document.getElementById("typeName-type").value; // Must start with "/Lotus/", contain only A–Z letters, no "//", and not end with "/" diff --git a/static/webui/translations/de.js b/static/webui/translations/de.js index 6d65f15d..5e2f33fa 100644 --- a/static/webui/translations/de.js +++ b/static/webui/translations/de.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `Incarnon-Entwicklungsfortschritte`, inventory_Boosters: `Booster`, inventory_flavourItems: `Sammlerstücke`, + inventory_shipDecorations: `Schiffsdekorationen`, inventory_bulkAddSuits: `Fehlende Warframes hinzufügen`, inventory_bulkAddWeapons: `Fehlende Waffen hinzufügen`, inventory_bulkAddSpaceSuits: `Fehlende Archwings hinzufügen`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `Fehlende Wächter hinzufügen`, inventory_bulkAddSentinelWeapons: `Fehlende Wächter-Waffen hinzufügen`, inventory_bulkAddFlavourItems: `[UNTRANSLATED] Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `[UNTRANSLATED] Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `Fehlende Incarnon-Entwicklungsfortschritte hinzufügen`, inventory_bulkRankUpSuits: `Alle Warframes auf Max. Rang`, inventory_bulkRankUpWeapons: `Alle Waffen auf Max. Rang`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `Void-Spuren nicht verbrauchen`, cheats_dontSubtractConsumables: `Verbrauchsgegenstände (Ausrüstung) nicht verbrauchen`, cheats_unlockAllShipFeatures: `Alle Schiffs-Funktionen freischalten`, - cheats_unlockAllShipDecorations: `Alle Schiffsdekorationen freischalten`, cheats_unlockAllSkins: `Alle Skins freischalten`, cheats_unlockAllCapturaScenes: `Alle Photora-Szenen freischalten`, cheats_universalPolarityEverywhere: `Universelle Polarität überall`, diff --git a/static/webui/translations/en.js b/static/webui/translations/en.js index f9e42b8f..03c1e6f2 100644 --- a/static/webui/translations/en.js +++ b/static/webui/translations/en.js @@ -108,6 +108,7 @@ dict = { inventory_evolutionProgress: `Incarnon Evolution Progress`, inventory_Boosters: `Boosters`, inventory_flavourItems: `Flavour Items`, + inventory_shipDecorations: `Ship Decorations`, inventory_bulkAddSuits: `Add Missing Warframes`, inventory_bulkAddWeapons: `Add Missing Weapons`, inventory_bulkAddSpaceSuits: `Add Missing Archwings`, @@ -115,6 +116,7 @@ dict = { inventory_bulkAddSentinels: `Add Missing Sentinels`, inventory_bulkAddSentinelWeapons: `Add Missing Sentinel Weapons`, inventory_bulkAddFlavourItems: `Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `Add Missing Incarnon Evolution Progress`, inventory_bulkRankUpSuits: `Max Rank All Warframes`, inventory_bulkRankUpWeapons: `Max Rank All Weapons`, @@ -204,7 +206,6 @@ dict = { cheats_dontSubtractVoidTraces: `Don't Subtract Void Traces`, cheats_dontSubtractConsumables: `Don't Subtract Consumables`, cheats_unlockAllShipFeatures: `Unlock All Ship Features`, - cheats_unlockAllShipDecorations: `Unlock All Ship Decorations`, cheats_unlockAllSkins: `Unlock All Skins`, cheats_unlockAllCapturaScenes: `Unlock All Captura Scenes`, cheats_universalPolarityEverywhere: `Universal Polarity Everywhere`, diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index c21ab29a..b6f6918f 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `Progreso de evolución Incarnon`, inventory_Boosters: `Potenciadores`, inventory_flavourItems: `Ítems estéticos`, + inventory_shipDecorations: `Decoraciones de nave`, inventory_bulkAddSuits: `Agregar Warframes faltantes`, inventory_bulkAddWeapons: `Agregar armas faltantes`, inventory_bulkAddSpaceSuits: `Agregar Archwings faltantes`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `Agregar centinelas faltantes`, inventory_bulkAddSentinelWeapons: `Agregar armas de centinela faltantes`, inventory_bulkAddFlavourItems: `[UNTRANSLATED] Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `[UNTRANSLATED] Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `Completar el progreso de evolución Incarnon faltante`, inventory_bulkRankUpSuits: `Maximizar rango de todos los Warframes`, inventory_bulkRankUpWeapons: `Maximizar rango de todas las armas`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `No descontar vestigios del Vacío`, cheats_dontSubtractConsumables: `No restar consumibles`, cheats_unlockAllShipFeatures: `Desbloquear todas las funciones de nave`, - cheats_unlockAllShipDecorations: `Desbloquear todas las decoraciones de nave`, cheats_unlockAllSkins: `Desbloquear todas las skins`, cheats_unlockAllCapturaScenes: `Desbloquear todas las escenas de Captura`, cheats_universalPolarityEverywhere: `Polaridad universal en todas partes`, diff --git a/static/webui/translations/fr.js b/static/webui/translations/fr.js index ec4fae6f..42480b1a 100644 --- a/static/webui/translations/fr.js +++ b/static/webui/translations/fr.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `Progrès de l'évolution Incarnon`, inventory_Boosters: `Boosters`, inventory_flavourItems: `[UNTRANSLATED] Flavour Items`, + inventory_shipDecorations: `Décorations du vaisseau`, inventory_bulkAddSuits: `Ajouter les Warframes manquantes`, inventory_bulkAddWeapons: `Ajouter les armes manquantes`, inventory_bulkAddSpaceSuits: `Ajouter les Archwings manquants`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `Ajouter les Sentinelles manquantes`, inventory_bulkAddSentinelWeapons: `Ajouter les armes de Sentinelles manquantes`, inventory_bulkAddFlavourItems: `[UNTRANSLATED] Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `[UNTRANSLATED] Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `Ajouter les évolutions Incarnon manquantes`, inventory_bulkRankUpSuits: `Toutes les Warframes au rang max`, inventory_bulkRankUpWeapons: `Toutes les armes au rang max`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `Ne pas consommer de Void Traces`, 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_unlockAllSkins: `Débloquer tous les skins`, cheats_unlockAllCapturaScenes: `Débloquer toutes les scènes captura`, cheats_universalPolarityEverywhere: `Polarités universelles partout`, diff --git a/static/webui/translations/ru.js b/static/webui/translations/ru.js index 6aae5bac..3249bca6 100644 --- a/static/webui/translations/ru.js +++ b/static/webui/translations/ru.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `Прогресс эволюции Инкарнонов`, inventory_Boosters: `Бустеры`, inventory_flavourItems: `Уникальные предметы`, + inventory_shipDecorations: `Украшения корабля`, inventory_bulkAddSuits: `Добавить отсутствующие Варфреймы`, inventory_bulkAddWeapons: `Добавить отсутствующее оружие`, inventory_bulkAddSpaceSuits: `Добавить отсутствующие Арчвинги`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `Добавить отсутствующих Стражей`, inventory_bulkAddSentinelWeapons: `Добавить отсутствующее оружие Стражей`, inventory_bulkAddFlavourItems: `Добавить отсутствующие Уникальные предметы`, + inventory_bulkAddShipDecorations: `Добавить отсутствующие украшения корабля`, inventory_bulkAddEvolutionProgress: `Добавить отсутствующий прогресс эволюции Инкарнонов`, inventory_bulkRankUpSuits: `Макс. ранг всех Варфреймов`, inventory_bulkRankUpWeapons: `Макс. ранг всего оружия`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `Не вычитать количество Отголосков Бездны`, cheats_dontSubtractConsumables: `Не вычитать количество расходников`, cheats_unlockAllShipFeatures: `Разблокировать все функции корабля`, - cheats_unlockAllShipDecorations: `Разблокировать все украшения корабля`, cheats_unlockAllSkins: `Разблокировать все скины`, cheats_unlockAllCapturaScenes: `Разблокировать все сцены Каптуры`, cheats_universalPolarityEverywhere: `Универсальная полярность везде`, diff --git a/static/webui/translations/uk.js b/static/webui/translations/uk.js index de48e9b1..cbe8086b 100644 --- a/static/webui/translations/uk.js +++ b/static/webui/translations/uk.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `Прогрес еволюції Інкарнонів`, inventory_Boosters: `Посилення`, inventory_flavourItems: `Унікальні предмети`, + inventory_shipDecorations: `Прикраси судна`, inventory_bulkAddSuits: `Додати відсутні Ворфрейми`, inventory_bulkAddWeapons: `Додати відсутню зброю`, inventory_bulkAddSpaceSuits: `Додати відсутні Арквінґи`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `Додати відсутніх Вартових`, inventory_bulkAddSentinelWeapons: `Додати відсутню зброю Вартових`, inventory_bulkAddFlavourItems: `[UNTRANSLATED] Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `[UNTRANSLATED] Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `Додати відсутній прогрес еволюції Інкарнонів`, inventory_bulkRankUpSuits: `Макс. рівень всіх Ворфреймів`, inventory_bulkRankUpWeapons: `Макс. рівень всієї зброї`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `Не вираховувати кількість Відлуння`, cheats_dontSubtractConsumables: `Не вираховувати кількість витратних матеріалів`, cheats_unlockAllShipFeatures: `Розблокувати всі функції судна`, - cheats_unlockAllShipDecorations: `Розблокувати всі прикраси судна`, cheats_unlockAllSkins: `Розблокувати всі скіни`, cheats_unlockAllCapturaScenes: `Розблокувати всі сцени Світлописця`, cheats_universalPolarityEverywhere: `Будь-яка полярність скрізь`, diff --git a/static/webui/translations/zh.js b/static/webui/translations/zh.js index 3b20fded..87e35451 100644 --- a/static/webui/translations/zh.js +++ b/static/webui/translations/zh.js @@ -109,6 +109,7 @@ dict = { inventory_evolutionProgress: `灵化之源进度`, inventory_Boosters: `加成器`, inventory_flavourItems: `装饰物品`, + inventory_shipDecorations: `飞船装饰`, inventory_bulkAddSuits: `添加缺失战甲`, inventory_bulkAddWeapons: `添加缺失武器`, inventory_bulkAddSpaceSuits: `添加缺失载具`, @@ -116,6 +117,7 @@ dict = { inventory_bulkAddSentinels: `添加缺失守护`, inventory_bulkAddSentinelWeapons: `添加缺失守护武器`, inventory_bulkAddFlavourItems: `[UNTRANSLATED] Add Missing Flavour Items`, + inventory_bulkAddShipDecorations: `[UNTRANSLATED] Add Missing Ship Decorations`, inventory_bulkAddEvolutionProgress: `添加缺失的灵化之源进度`, inventory_bulkRankUpSuits: `所有战甲升满级`, inventory_bulkRankUpWeapons: `所有武器升满级`, @@ -205,7 +207,6 @@ dict = { cheats_dontSubtractVoidTraces: `虚空光体无消耗`, cheats_dontSubtractConsumables: `消耗物品使用时无损耗`, cheats_unlockAllShipFeatures: `解锁所有飞船功能`, - cheats_unlockAllShipDecorations: `解锁所有飞船装饰`, cheats_unlockAllSkins: `解锁所有外观`, cheats_unlockAllCapturaScenes: `解锁所有Captura场景`, cheats_universalPolarityEverywhere: `全局万用极性`,