feat(webui): remove IsNew #2926

Merged
Sainan merged 2 commits from AMelonInsideLemon/SpaceNinjaServer:remove-IsNew into main 2025-10-23 23:21:38 -07:00
11 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,24 @@
import { getInventory } from "../../services/inventoryService.ts";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import type { RequestHandler } from "express";
import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts";
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
export const removeIsNewController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const filteredEquipmentKeys = equipmentKeys.filter(k => k !== "CrewShipWeapons" && k !== "CrewShipSalvagedWeapons");
const inventory = await getInventory(accountId, [...filteredEquipmentKeys, "WeaponSkins"].join(" "));
for (const key of filteredEquipmentKeys) {
if (key in inventory) {
for (const equipment of inventory[key]) {
if (equipment.IsNew) equipment.IsNew = false;
}
}
}
for (const equipment of inventory.WeaponSkins) {
if (equipment.IsNew) equipment.IsNew = false;
}
await inventory.save();
res.end();
broadcastInventoryUpdate(req);
};

View File

@ -22,6 +22,7 @@ import { unlockAllScansController } from "../controllers/custom/unlockAllScansCo
import { unlockAllShipFeaturesController } from "../controllers/custom/unlockAllShipFeaturesController.ts"; import { unlockAllShipFeaturesController } from "../controllers/custom/unlockAllShipFeaturesController.ts";
import { unlockAllCapturaScenesController } from "../controllers/custom/unlockAllCapturaScenesController.ts"; import { unlockAllCapturaScenesController } from "../controllers/custom/unlockAllCapturaScenesController.ts";
import { removeCustomizationController } from "../controllers/custom/removeCustomizationController.ts"; import { removeCustomizationController } from "../controllers/custom/removeCustomizationController.ts";
import { removeIsNewController } from "../controllers/custom/removeIsNewController.ts";
import { abilityOverrideController } from "../controllers/custom/abilityOverrideController.ts"; import { abilityOverrideController } from "../controllers/custom/abilityOverrideController.ts";
import { createAccountController } from "../controllers/custom/createAccountController.ts"; import { createAccountController } from "../controllers/custom/createAccountController.ts";
@ -73,6 +74,7 @@ customRouter.get("/unlockAllScans", unlockAllScansController);
customRouter.get("/unlockAllShipFeatures", unlockAllShipFeaturesController); customRouter.get("/unlockAllShipFeatures", unlockAllShipFeaturesController);
customRouter.get("/unlockAllCapturaScenes", unlockAllCapturaScenesController); customRouter.get("/unlockAllCapturaScenes", unlockAllCapturaScenesController);
customRouter.get("/removeCustomization", removeCustomizationController); customRouter.get("/removeCustomization", removeCustomizationController);
customRouter.get("/removeIsNew", removeIsNewController);
customRouter.post("/abilityOverride", abilityOverrideController); customRouter.post("/abilityOverride", abilityOverrideController);
customRouter.post("/createAccount", createAccountController); customRouter.post("/createAccount", createAccountController);

View File

@ -558,6 +558,7 @@
<button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['ShipDecorations']);" data-loc="inventory_bulkAddShipDecorations"></button> <button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['ShipDecorations']);" data-loc="inventory_bulkAddShipDecorations"></button>
<button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['WeaponSkins']);" data-loc="inventory_bulkAddWeaponSkins"></button> <button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['WeaponSkins']);" data-loc="inventory_bulkAddWeaponSkins"></button>
<button class="btn btn-primary" onclick="debounce(addMissingEvolutionProgress);" data-loc="inventory_bulkAddEvolutionProgress"></button> <button class="btn btn-primary" onclick="debounce(addMissingEvolutionProgress);" data-loc="inventory_bulkAddEvolutionProgress"></button>
<button class="btn btn-primary" onclick="removeIsNew();" data-loc="inventory_removeIsNew"></button>
</div> </div>
<div class="mb-2 d-flex flex-wrap gap-2"> <div class="mb-2 d-flex flex-wrap gap-2">
<button class="btn btn-success" onclick="debounce(maxRankAllEquipment, ['Suits']);" data-loc="inventory_bulkRankUpSuits"></button> <button class="btn btn-success" onclick="debounce(maxRankAllEquipment, ['Suits']);" data-loc="inventory_bulkRankUpSuits"></button>

View File

@ -2177,6 +2177,15 @@ function removeCustomization(uniqueName) {
}); });
} }
function removeIsNew() {
revalidateAuthz().then(() => {
const req = $.get("/custom/removeIsNew?" + window.authz);
req.done(() => {
updateInventory();
});
});
}
function getRequiredParts(category, WeaponType) { function getRequiredParts(category, WeaponType) {
switch (category) { switch (category) {
case "Hoverboards": case "Hoverboards":

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Alle Wächter-Waffen auf Max. Rang`, inventory_bulkRankUpSentinelWeapons: `Alle Wächter-Waffen auf Max. Rang`,
inventory_bulkRankUpEvolutionProgress: `Alle Incarnon-Entwicklungsfortschritte auf Max. Rang`, inventory_bulkRankUpEvolutionProgress: `Alle Incarnon-Entwicklungsfortschritte auf Max. Rang`,
inventory_maxPlexus: `Plexus auf Max. Rang`, inventory_maxPlexus: `Plexus auf Max. Rang`,
inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
quests_list: `Quests`, quests_list: `Quests`,
quests_completeAll: `Alle Quests abschließen`, quests_completeAll: `Alle Quests abschließen`,

View File

@ -134,6 +134,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Max Rank All Sentinel Weapons`, inventory_bulkRankUpSentinelWeapons: `Max Rank All Sentinel Weapons`,
inventory_bulkRankUpEvolutionProgress: `Max Rank All Incarnon Evolution Progress`, inventory_bulkRankUpEvolutionProgress: `Max Rank All Incarnon Evolution Progress`,
inventory_maxPlexus: `Max Rank Plexus`, inventory_maxPlexus: `Max Rank Plexus`,
inventory_removeIsNew: `Remove New Equipment Exclamation Icon`,
quests_list: `Quests`, quests_list: `Quests`,
quests_completeAll: `Complete All Quests`, quests_completeAll: `Complete All Quests`,

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Maximizar rango de todas las armas de centinela`, inventory_bulkRankUpSentinelWeapons: `Maximizar rango de todas las armas de centinela`,
inventory_bulkRankUpEvolutionProgress: `Maximizar todo el progreso de evolución Incarnon`, inventory_bulkRankUpEvolutionProgress: `Maximizar todo el progreso de evolución Incarnon`,
inventory_maxPlexus: `Rango máximo de Plexus`, inventory_maxPlexus: `Rango máximo de Plexus`,
inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
quests_list: `Misiones`, quests_list: `Misiones`,
quests_completeAll: `Completar todas las misiones`, quests_completeAll: `Completar todas las misiones`,

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Toutes les armes de Sentinelles au rang max`, inventory_bulkRankUpSentinelWeapons: `Toutes les armes de Sentinelles au rang max`,
inventory_bulkRankUpEvolutionProgress: `Toutes les évolutions Incarnon au rang max`, inventory_bulkRankUpEvolutionProgress: `Toutes les évolutions Incarnon au rang max`,
inventory_maxPlexus: `Plexus au rang max`, inventory_maxPlexus: `Plexus au rang max`,
inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
quests_list: `Quêtes`, quests_list: `Quêtes`,
quests_completeAll: `Compléter toutes les quêtes`, quests_completeAll: `Compléter toutes les quêtes`,

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Макс. ранг всего оружия Стражей`, inventory_bulkRankUpSentinelWeapons: `Макс. ранг всего оружия Стражей`,
inventory_bulkRankUpEvolutionProgress: `Макс. ранг всех эволюций Инкарнонов`, inventory_bulkRankUpEvolutionProgress: `Макс. ранг всех эволюций Инкарнонов`,
inventory_maxPlexus: `Макс. ранг Плексуса`, inventory_maxPlexus: `Макс. ранг Плексуса`,
inventory_removeIsNew: `Удалить значок восклицательного знака нового снаряжения`,
quests_list: `Квесты`, quests_list: `Квесты`,
quests_completeAll: `Завершить все квесты`, quests_completeAll: `Завершить все квесты`,

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `Макс. рівень всієї зброї Вартових`, inventory_bulkRankUpSentinelWeapons: `Макс. рівень всієї зброї Вартових`,
inventory_bulkRankUpEvolutionProgress: `Макс. рівень всіх еволюцій Інкарнонів`, inventory_bulkRankUpEvolutionProgress: `Макс. рівень всіх еволюцій Інкарнонів`,
inventory_maxPlexus: `Макс. рівень Плексу`, inventory_maxPlexus: `Макс. рівень Плексу`,
inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
quests_list: `Пригоди`, quests_list: `Пригоди`,
quests_completeAll: `Закінчити всі пригоди`, quests_completeAll: `Закінчити всі пригоди`,

View File

@ -135,6 +135,7 @@ dict = {
inventory_bulkRankUpSentinelWeapons: `所有守护武器升满级`, inventory_bulkRankUpSentinelWeapons: `所有守护武器升满级`,
inventory_bulkRankUpEvolutionProgress: `所有灵化之源进度最大等级`, inventory_bulkRankUpEvolutionProgress: `所有灵化之源进度最大等级`,
inventory_maxPlexus: `最大深控等级`, inventory_maxPlexus: `最大深控等级`,
inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
quests_list: `系列任务`, quests_list: `系列任务`,
quests_completeAll: `完成所有任务`, quests_completeAll: `完成所有任务`,