diff --git a/src/controllers/custom/addModularEquipmentController.ts b/src/controllers/custom/addModularEquipmentController.ts index 5e09902b..ea51e2d3 100644 --- a/src/controllers/custom/addModularEquipmentController.ts +++ b/src/controllers/custom/addModularEquipmentController.ts @@ -1,7 +1,8 @@ import { getAccountIdForRequest } from "@/src/services/loginService"; import { getInventory, addEquipment, occupySlot, productCategoryToInventoryBin } from "@/src/services/inventoryService"; -import { RequestHandler } from "express"; import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper"; +import { ExportWeapons } from "warframe-public-export-plus"; +import { RequestHandler } from "express"; export const addModularEquipmentController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); @@ -9,6 +10,23 @@ export const addModularEquipmentController: RequestHandler = async (req, res) => const category = modularWeaponTypes[request.ItemType]; const inventoryBin = productCategoryToInventoryBin(category)!; const inventory = await getInventory(accountId, `${category} ${inventoryBin}`); + request.ModularParts.forEach(part => { + if (ExportWeapons[part].gunType) { + if (category == "LongGuns") { + request.ItemType = { + GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary", + GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryShotgun", + GT_BEAM: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryBeam" + }[ExportWeapons[part].gunType]; + } else { + request.ItemType = { + GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary", + GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryShotgun", + GT_BEAM: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryBeam" + }[ExportWeapons[part].gunType]; + } + } + }); addEquipment(inventory, category, request.ItemType, request.ModularParts); occupySlot(inventory, inventoryBin, true); await inventory.save(); diff --git a/static/webui/index.html b/static/webui/index.html index dcb2539c..f5df02df 100644 --- a/static/webui/index.html +++ b/static/webui/index.html @@ -163,10 +163,15 @@
-
+
+
@@ -179,10 +184,15 @@
-
+
+
@@ -645,6 +655,10 @@ + + + + diff --git a/static/webui/script.js b/static/webui/script.js index f7abb431..0d5690fd 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -194,6 +194,14 @@ function fetchItemList() { uniqueName: "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon", name: loc("code_zaw") }); + data.LongGuns.push({ + uniqueName: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary", + name: loc("code_kitgun") + }); + data.Pistols.push({ + uniqueName: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary", + name: loc("code_kitgun") + }); const itemMap = { // Generics for rivens @@ -203,12 +211,10 @@ function fetchItemList() { "/Lotus/Weapons/Tenno/Rifle/LotusRifle": { name: loc("code_rifle") }, "/Lotus/Weapons/Tenno/Shotgun/LotusShotgun": { name: loc("code_shotgun") }, // Modular weapons - "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryBeam": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryLauncher": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryShotgun": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimarySniper": { name: loc("code_kitgun") }, - "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryBeam": { name: loc("code_kitgun") }, "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryShotgun": { name: loc("code_kitgun") }, "/Lotus/Weapons/Sentients/OperatorAmplifiers/SentTrainingAmplifier/OperatorTrainingAmpWeapon": { @@ -249,7 +255,11 @@ function fetchItemList() { "LWPT_AMP_BRACE", "LWPT_BLADE", "LWPT_HILT", - "LWPT_HILT_WEIGHT" + "LWPT_HILT_WEIGHT", + "LWPT_GUN_PRIMARY_HANDLE", + "LWPT_GUN_SECONDARY_HANDLE", + "LWPT_GUN_BARREL", + "LWPT_GUN_CLIP" ]; if (supportedModularParts.includes(item.partType)) { const option = document.createElement("option"); @@ -259,6 +269,7 @@ function fetchItemList() { .getElementById("datalist-" + type + "-" + item.partType.slice(5)) .appendChild(option); } else { + console.log(item.partType); const option = document.createElement("option"); option.setAttribute("data-key", item.uniqueName); option.value = item.name; @@ -693,6 +704,12 @@ function doAcquireModularEquipment(category, ItemType) { case "Melee": requiredParts = ["BLADE", "HILT", "HILT_WEIGHT"]; break; + case "LongGuns": + requiredParts = ["GUN_BARREL", "GUN_PRIMARY_HANDLE", "GUN_CLIP"]; + break; + case "Pistols": + requiredParts = ["GUN_BARREL", "GUN_SECONDARY_HANDLE", "GUN_CLIP"]; + break; } requiredParts.forEach(part => { const partName = getKey(document.getElementById("acquire-type-" + category + "-" + part)); @@ -1357,7 +1374,9 @@ function toast(text) { function handleModularSelection(category) { const modularWeapons = [ "/Lotus/Weapons/Sentients/OperatorAmplifiers/OperatorAmpWeapon", - "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon" + "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon", + "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary", + "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary" ]; const itemType = getKey(document.getElementById("acquire-type-" + category)); @@ -1370,9 +1389,11 @@ function handleModularSelection(category) { { const modularWeapons = [ "/Lotus/Weapons/Sentients/OperatorAmplifiers/OperatorAmpWeapon", - "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon" + "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon", + "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary", + "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary" ]; - const supportedModularInventoryCategory = ["OperatorAmps", "Melee"]; + const supportedModularInventoryCategory = ["OperatorAmps", "Melee", "LongGuns", "Pistols"]; supportedModularInventoryCategory.forEach(inventoryCategory => { document.getElementById("acquire-type-" + inventoryCategory).addEventListener("input", function () { const modularFields = document.getElementById("modular-" + inventoryCategory);