XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat(webui): remove IsNew (#2926)

Closes #2917 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2926 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>

43fa1978
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

11 个文件 +43 -0
Added src/controllers/custom/removeIsNewController.ts +24 -0
@@ -0,0 +1,24 @@
1 import { getInventory } from "../../services/inventoryService.ts";
2 import { getAccountIdForRequest } from "../../services/loginService.ts";
3 import type { RequestHandler } from "express";
4 import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts";
5 import { broadcastInventoryUpdate } from "../../services/wsService.ts";
6
7 export const removeIsNewController: RequestHandler = async (req, res) => {
8 const accountId = await getAccountIdForRequest(req);
9 const filteredEquipmentKeys = equipmentKeys.filter(k => k !== "CrewShipWeapons" && k !== "CrewShipSalvagedWeapons");
10 const inventory = await getInventory(accountId, [...filteredEquipmentKeys, "WeaponSkins"].join(" "));
11 for (const key of filteredEquipmentKeys) {
12 if (key in inventory) {
13 for (const equipment of inventory[key]) {
14 if (equipment.IsNew) equipment.IsNew = false;
15 }
16 }
17 }
18 for (const equipment of inventory.WeaponSkins) {
19 if (equipment.IsNew) equipment.IsNew = false;
20 }
21 await inventory.save();
22 res.end();
23 broadcastInventoryUpdate(req);
24 };
Modified src/routes/custom.ts +2 -0
@@ -22,6 +22,7 @@ import { unlockAllScansController } from "../controllers/custom/unlockAllScansCo
22 22 import { unlockAllShipFeaturesController } from "../controllers/custom/unlockAllShipFeaturesController.ts";
23 23 import { unlockAllCapturaScenesController } from "../controllers/custom/unlockAllCapturaScenesController.ts";
24 24 import { removeCustomizationController } from "../controllers/custom/removeCustomizationController.ts";
25 import { removeIsNewController } from "../controllers/custom/removeIsNewController.ts";
25 26
26 27 import { abilityOverrideController } from "../controllers/custom/abilityOverrideController.ts";
27 28 import { createAccountController } from "../controllers/custom/createAccountController.ts";
@@ -73,6 +74,7 @@ customRouter.get("/unlockAllScans", unlockAllScansController);
73 74 customRouter.get("/unlockAllShipFeatures", unlockAllShipFeaturesController);
74 75 customRouter.get("/unlockAllCapturaScenes", unlockAllCapturaScenesController);
75 76 customRouter.get("/removeCustomization", removeCustomizationController);
77 customRouter.get("/removeIsNew", removeIsNewController);
76 78
77 79 customRouter.post("/abilityOverride", abilityOverrideController);
78 80 customRouter.post("/createAccount", createAccountController);
Modified static/webui/index.html +1 -0
@@ -558,6 +558,7 @@
558 558 <button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['ShipDecorations']);" data-loc="inventory_bulkAddShipDecorations"></button>
559 559 <button class="btn btn-primary" onclick="debounce(addMissingEquipment, ['WeaponSkins']);" data-loc="inventory_bulkAddWeaponSkins"></button>
560 560 <button class="btn btn-primary" onclick="debounce(addMissingEvolutionProgress);" data-loc="inventory_bulkAddEvolutionProgress"></button>
561 <button class="btn btn-primary" onclick="removeIsNew();" data-loc="inventory_removeIsNew"></button>
561 562 </div>
562 563 <div class="mb-2 d-flex flex-wrap gap-2">
563 564 <button class="btn btn-success" onclick="debounce(maxRankAllEquipment, ['Suits']);" data-loc="inventory_bulkRankUpSuits"></button>
Modified static/webui/script.js +9 -0
@@ -2177,6 +2177,15 @@ function removeCustomization(uniqueName) {
2177 2177 });
2178 2178 }
2179 2179
2180 function removeIsNew() {
2181 revalidateAuthz().then(() => {
2182 const req = $.get("/custom/removeIsNew?" + window.authz);
2183 req.done(() => {
2184 updateInventory();
2185 });
2186 });
2187 }
2188
2180 2189 function getRequiredParts(category, WeaponType) {
2181 2190 switch (category) {
2182 2191 case "Hoverboards":
Modified static/webui/translations/de.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `Alle Wächter-Waffen auf Max. Rang`,
136 136 inventory_bulkRankUpEvolutionProgress: `Alle Incarnon-Entwicklungsfortschritte auf Max. Rang`,
137 137 inventory_maxPlexus: `Plexus auf Max. Rang`,
138 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
138 139
139 140 quests_list: `Quests`,
140 141 quests_completeAll: `Alle Quests abschließen`,
Modified static/webui/translations/en.js +1 -0
@@ -134,6 +134,7 @@ dict = {
134 134 inventory_bulkRankUpSentinelWeapons: `Max Rank All Sentinel Weapons`,
135 135 inventory_bulkRankUpEvolutionProgress: `Max Rank All Incarnon Evolution Progress`,
136 136 inventory_maxPlexus: `Max Rank Plexus`,
137 inventory_removeIsNew: `Remove New Equipment Exclamation Icon`,
137 138
138 139 quests_list: `Quests`,
139 140 quests_completeAll: `Complete All Quests`,
Modified static/webui/translations/es.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `Maximizar rango de todas las armas de centinela`,
136 136 inventory_bulkRankUpEvolutionProgress: `Maximizar todo el progreso de evolución Incarnon`,
137 137 inventory_maxPlexus: `Rango máximo de Plexus`,
138 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
138 139
139 140 quests_list: `Misiones`,
140 141 quests_completeAll: `Completar todas las misiones`,
Modified static/webui/translations/fr.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `Toutes les armes de Sentinelles au rang max`,
136 136 inventory_bulkRankUpEvolutionProgress: `Toutes les évolutions Incarnon au rang max`,
137 137 inventory_maxPlexus: `Plexus au rang max`,
138 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
138 139
139 140 quests_list: `Quêtes`,
140 141 quests_completeAll: `Compléter toutes les quêtes`,
Modified static/webui/translations/ru.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `Макс. ранг всего оружия Стражей`,
136 136 inventory_bulkRankUpEvolutionProgress: `Макс. ранг всех эволюций Инкарнонов`,
137 137 inventory_maxPlexus: `Макс. ранг Плексуса`,
138 inventory_removeIsNew: `Удалить значок восклицательного знака нового снаряжения`,
138 139
139 140 quests_list: `Квесты`,
140 141 quests_completeAll: `Завершить все квесты`,
Modified static/webui/translations/uk.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `Макс. рівень всієї зброї Вартових`,
136 136 inventory_bulkRankUpEvolutionProgress: `Макс. рівень всіх еволюцій Інкарнонів`,
137 137 inventory_maxPlexus: `Макс. рівень Плексу`,
138 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
138 139
139 140 quests_list: `Пригоди`,
140 141 quests_completeAll: `Закінчити всі пригоди`,
Modified static/webui/translations/zh.js +1 -0
@@ -135,6 +135,7 @@ dict = {
135 135 inventory_bulkRankUpSentinelWeapons: `所有守护武器升满级`,
136 136 inventory_bulkRankUpEvolutionProgress: `所有灵化之源进度最大等级`,
137 137 inventory_maxPlexus: `最大深控等级`,
138 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
138 139
139 140 quests_list: `系列任务`,
140 141 quests_completeAll: `完成所有任务`,