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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

chore(webui): move quests to inventory tab (#3764)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3764 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>

18cbeb12
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

12 个文件 +74 -102
Modified src/controllers/custom/manageQuestsController.ts +1 -11
@@ -1,11 +1,6 @@
1 1 import { getInventory } from "../../services/inventoryService.ts";
2 2 import { getAccountIdForRequest } from "../../services/loginService.ts";
3 import {
4 addQuestKey,
5 completeQuest,
6 giveKeyChainMissionReward,
7 giveKeyChainStageTriggered
8 } from "../../services/questService.ts";
3 import { completeQuest, giveKeyChainMissionReward, giveKeyChainStageTriggered } from "../../services/questService.ts";
9 4 import { logger } from "../../utils/logger.ts";
10 5 import type { RequestHandler } from "express";
11 6 import { ExportKeys } from "warframe-public-export-plus";
@@ -16,7 +11,6 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
16 11 const operation = req.query.operation as
17 12 | "completeAll"
18 13 | "resetAll"
19 | "giveAll"
20 14 | "completeKey"
21 15 | "deleteKey"
22 16 | "resetKey"
@@ -50,10 +44,6 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
50 44 inventory.ActiveQuest = "";
51 45 break;
52 46 }
53 case "giveAll": {
54 allQuestKeys.forEach(questKey => addQuestKey(inventory, { ItemType: questKey }, true));
55 break;
56 }
57 47 case "deleteKey": {
58 48 const questKey = inventory.QuestKeys.find(key => key.ItemType === questItemType);
59 49 if (!questKey) {
Modified src/controllers/custom/removeItemsController.ts +1 -0
@@ -11,6 +11,7 @@ export const removeItemsController: RequestHandler = async (req, res) => {
11 11 | "WeaponSkins"
12 12 | "ShipDecorations"
13 13 | "FlavourItems"
14 | "QuestKeys"
14 15 | undefined;
15 16 if (category) {
16 17 const inventory = await getInventory(accountId, category);
Modified src/routes/webui.ts +0 -1
@@ -39,7 +39,6 @@ webuiRouter.get("/webui/", virtualRouteController); // can be handled by express
39 39 webuiRouter.get("/webui/inventory", virtualRouteController);
40 40 webuiRouter.get("/webui/detailedView", virtualRouteController);
41 41 webuiRouter.get("/webui/mods", virtualRouteController);
42 webuiRouter.get("/webui/quests", virtualRouteController);
43 42 webuiRouter.get("/webui/cheats", virtualRouteController);
44 43 webuiRouter.get("/webui/import", virtualRouteController);
45 44 webuiRouter.get("/webui/guildView", virtualRouteController);
Modified static/webui/index.html +20 -40
@@ -64,9 +64,6 @@
64 64 <li class="nav-item">
65 65 <a class="nav-link" href="/webui/mods" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_mods"></a>
66 66 </li>
67 <li class="nav-item">
68 <a class="nav-link" href="/webui/quests" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_quests"></a>
69 </li>
70 67 <li class="nav-item">
71 68 <a class="nav-link" href="/webui/cheats" data-bs-dismiss="offcanvas" data-bs-target="#sidebar" data-loc="navbar_cheats"></a>
72 69 </li>
@@ -464,6 +461,22 @@
464 461 </div>
465 462 </div>
466 463 <div class="row g-3 mb-3">
464 <div class="col-lg-6">
465 <div class="card" style="height: 400px;">
466 <div class="card-header" data-cardType="QuestKeys"></div>
467 <div class="card-body d-flex flex-column">
468 <form class="input-group mb-3" onsubmit="doAcquireEquipment('QuestKeys');return false;">
469 <input class="form-control" id="acquire-type-QuestKeys" list="datalist-QuestKeys" autocomplete="off" />
470 <button class="btn btn-primary" type="submit" data-loc="general_addButton"></button>
471 </form>
472 <div class="overflow-auto">
473 <table class="table table-hover w-100">
474 <tbody id="QuestKeys-list"></tbody>
475 </table>
476 </div>
477 </div>
478 </div>
479 </div>
467 480 <div class="col-lg-6">
468 481 <div class="card" style="height: 400px;">
469 482 <div class="card-header" data-cardType="EvolutionProgress"></div>
@@ -480,6 +493,8 @@
480 493 </div>
481 494 </div>
482 495 </div>
496 </div>
497 <div class="row g-3 mb-3">
483 498 <div class="col-lg-6">
484 499 <div class="card" style="height: 400px;">
485 500 <div class="card-header" data-cardType="Boosters"></div>
@@ -496,8 +511,6 @@
496 511 </div>
497 512 </div>
498 513 </div>
499 </div>
500 <div class="row g-3 mb-3">
501 514 <div class="col-lg-6">
502 515 <div class="card" style="height: 400px;">
503 516 <div class="card-header" data-cardType="FlavourItems"></div>
@@ -514,6 +527,8 @@
514 527 </div>
515 528 </div>
516 529 </div>
530 </div>
531 <div class="row g-3 mb-3">
517 532 <div class="col-lg-6">
518 533 <div class="card" style="height: 400px;">
519 534 <div class="card-header" data-cardType="ShipDecorations"></div>
@@ -531,8 +546,6 @@
531 546 </div>
532 547 </div>
533 548 </div>
534 </div>
535 <div class="row g-3 mb-3">
536 549 <div class="col-lg-6">
537 550 <div class="card" style="height: 400px;">
538 551 <div class="card-header" data-cardType="WeaponSkins"></div>
@@ -890,39 +903,6 @@
890 903 </div>
891 904 </div>
892 905 </div>
893 <div data-route="/webui/quests" data-title-tag="navbar_quests">
894 <p class="mb-3 inventory-update-note"></p>
895 <div class="row g-3">
896 <div class="col-md-6">
897 <div class="card" style="height: 800px;">
898 <h5 class="card-header" data-loc="quests_list"></h5>
899 <div class="card-body d-flex flex-column">
900 <form class="input-group mb-3" onsubmit="doAcquireEquipment('QuestKeys');return false;">
901 <input class="form-control" id="acquire-type-QuestKeys" list="datalist-QuestKeys" autocomplete="off" />
902 <button class="btn btn-primary" type="submit" data-loc="general_addButton"></button>
903 </form>
904 <div class="overflow-auto">
905 <table class="table table-hover w-100">
906 <tbody id="QuestKeys-list"></tbody>
907 </table>
908 </div>
909 </div>
910 </div>
911 </div>
912 <div class="col-md-6">
913 <div class="card">
914 <h5 class="card-header" data-loc="general_bulkActions"></h5>
915 <div class="card-body">
916 <div class="d-flex flex-wrap gap-2">
917 <button class="btn btn-primary" onclick="doBulkQuestUpdate('giveAll');" data-loc="quests_giveAll"></button>
918 <button class="btn btn-primary" onclick="doBulkQuestUpdate('completeAll');" data-loc="quests_completeAll"></button>
919 <button class="btn btn-primary" onclick="doBulkQuestUpdate('resetAll');" data-loc="quests_resetAll"></button>
920 </div>
921 </div>
922 </div>
923 </div>
924 </div>
925 </div>
926 906 <div data-route="/webui/cheats" data-title-tag="navbar_cheats">
927 907 <div class="row g-3">
928 908 <div class="col-md-6">
Modified static/webui/script.js +31 -8
@@ -1664,7 +1664,6 @@ function translateInventoryDataToDom() {
1664 1664 }
1665 1665 });
1666 1666
1667 // Populate quests route
1668 1667 document.getElementById("QuestKeys-list").innerHTML = "";
1669 1668 data.QuestKeys.forEach(item => {
1670 1669 const tr = document.createElement("tr");
@@ -2631,31 +2630,55 @@ dictPromise.then(() => {
2631 2630 a.href = "#";
2632 2631 a.onclick = function (event) {
2633 2632 event.preventDefault();
2634 if (cardType != "EvolutionProgress") {
2635 debounce(addMissingEquipment, [cardType]);
2636 } else {
2633 if (cardType == "EvolutionProgress") {
2637 2634 debounce(addMissingEvolutionProgress);
2635 } else {
2636 debounce(addMissingEquipment, [cardType]);
2638 2637 }
2639 2638 };
2640 2639 a.title = loc("inventory_bulkAdd");
2641 2640 a.innerHTML = icons.plus;
2642 2641 butDiv.appendChild(a);
2643 2642 }
2644 if (!["Boosters", "FlavourItems", "ShipDecorations", "WeaponSkins"].includes(cardType)) {
2643 if (!["QuestKeys", "Boosters", "FlavourItems", "ShipDecorations", "WeaponSkins"].includes(cardType)) {
2645 2644 const a = document.createElement("a");
2646 2645 a.href = "#";
2647 2646 a.onclick = function (event) {
2648 2647 event.preventDefault();
2649 if (cardType != "EvolutionProgress") {
2650 debounce(maxRankAllEquipment, [cardType]);
2651 } else {
2648 if (cardType == "EvolutionProgress") {
2652 2649 debounce(maxRankAllEvolutions);
2650 } else {
2651 debounce(maxRankAllEquipment, [cardType]);
2653 2652 }
2654 2653 };
2655 2654 a.title = loc("inventory_bulkRankUp");
2656 2655 a.innerHTML = icons.arrowUp;
2657 2656 butDiv.appendChild(a);
2658 2657 }
2658 if (cardType == "QuestKeys") {
2659 {
2660 const a = document.createElement("a");
2661 a.href = "#";
2662 a.onclick = function (event) {
2663 event.preventDefault();
2664 doBulkQuestUpdate("completeAll");
2665 };
2666 a.title = loc("inventory_bulkComplete");
2667 a.innerHTML = icons.check;
2668 butDiv.appendChild(a);
2669 }
2670 {
2671 const a = document.createElement("a");
2672 a.href = "#";
2673 a.onclick = function (event) {
2674 event.preventDefault();
2675 doBulkQuestUpdate("resetAll");
2676 };
2677 a.title = loc("inventory_bulkReset");
2678 a.innerHTML = icons.arrowRotateRight;
2679 butDiv.appendChild(a);
2680 }
2681 }
2659 2682 if (!["EvolutionProgress", "Boosters"].includes(cardType)) {
2660 2683 const a = document.createElement("a");
2661 2684 a.href = "#";
Modified static/webui/translations/de.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `Inventar`,
133 133 navbar_guildView: `Clan`,
134 134 navbar_mods: `Mods`,
135 navbar_quests: `Quests`,
136 135 navbar_cheats: `Cheats`,
137 136 navbar_import: `Importieren`,
138 137 settings_passwordMismatch: `Die neuen Passwörter stimmen nicht überein.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `K-Drives`,
158 157 inventory_moaPets: `Moas`,
159 158 inventory_kubrowPets: `Bestien`,
159 inventory_questKeys: `Quests`,
160 160 inventory_evolutionProgress: `Incarnon-Entwicklungsfortschritte`,
161 161 inventory_boosters: `Booster`,
162 162 inventory_flavourItems: `<abbr title="Animationssets, Glyphen, Farbpaletten usw.">Sammlerstücke</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `Fehlende hinzufügen`,
166 166 inventory_bulkRankUp: `Alle auf Max. Rang setzen`,
167 167 inventory_bulkRemove: `Alle entfernen`,
168 inventory_bulkComplete: `[UNTRANSLATED] Complete All`,
169 inventory_bulkReset: `[UNTRANSLATED] Reset All`,
168 170 inventory_removeIsNew: `Entferne Ausrufezeichen bei neuem Equipment`,
169 171
170 quests_list: `Quests`,
171 quests_completeAll: `Alle Quests abschließen`,
172 quests_resetAll: `Alle Quests zurücksetzen`,
173 quests_giveAll: `Alle Quests erhalten`,
174
175 172 currency_RegularCredits: `Credits`,
176 173 currency_PremiumCredits: `Platinum`,
177 174 currency_FusionPoints: `Endo`,
Modified static/webui/translations/en.js +3 -6
@@ -131,7 +131,6 @@ dict = {
131 131 navbar_inventory: `Inventory`,
132 132 navbar_guildView: `Clan`,
133 133 navbar_mods: `Mods`,
134 navbar_quests: `Quests`,
135 134 navbar_cheats: `Cheats`,
136 135 navbar_import: `Import`,
137 136 settings_passwordMismatch: `The new passwords do not match.`,
@@ -156,6 +155,7 @@ dict = {
156 155 inventory_hoverboards: `K-Drives`,
157 156 inventory_moaPets: `Moas`,
158 157 inventory_kubrowPets: `Beasts`,
158 inventory_questKeys: `Quests`,
159 159 inventory_evolutionProgress: `Incarnon Evolution Progress`,
160 160 inventory_boosters: `Boosters`,
161 161 inventory_flavourItems: `<abbr title="Animation Sets, Glyphs, Palettes, etc.">Flavour Items</abbr>`,
@@ -164,13 +164,10 @@ dict = {
164 164 inventory_bulkAdd: `Add Missing`,
165 165 inventory_bulkRankUp: `Max Rank All`,
166 166 inventory_bulkRemove: `Remove all`,
167 inventory_bulkComplete: `Complete All`,
168 inventory_bulkReset: `Reset All`,
167 169 inventory_removeIsNew: `Remove New Equipment Exclamation Icon`,
168 170
169 quests_list: `Quests`,
170 quests_completeAll: `Complete All Quests`,
171 quests_resetAll: `Reset All Quests`,
172 quests_giveAll: `Give All Quests`,
173
174 171 currency_RegularCredits: `Credits`,
175 172 currency_PremiumCredits: `Platinum`,
176 173 currency_FusionPoints: `Endo`,
Modified static/webui/translations/es.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `Inventario`,
133 133 navbar_guildView: `Clan`,
134 134 navbar_mods: `Mods`,
135 navbar_quests: `Misiones`,
136 135 navbar_cheats: `Trucos`,
137 136 navbar_import: `Importar`,
138 137 settings_passwordMismatch: `[UNTRANSLATED] The new passwords do not match.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `K-Drives`,
158 157 inventory_moaPets: `Moas`,
159 158 inventory_kubrowPets: `Bestias`,
159 inventory_questKeys: `Misiones`,
160 160 inventory_evolutionProgress: `Progreso de evolución Incarnon`,
161 161 inventory_boosters: `Potenciadores`,
162 162 inventory_flavourItems: `<abbr title="Conjuntos de animaciones, glifos, paletas, etc.">Ítems estéticos</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `[UNTRANSLATED] Add Missing`,
166 166 inventory_bulkRankUp: `[UNTRANSLATED] Max Rank All`,
167 167 inventory_bulkRemove: `[UNTRANSLATED] Remove all`,
168 inventory_bulkComplete: `[UNTRANSLATED] Complete All`,
169 inventory_bulkReset: `[UNTRANSLATED] Reset All`,
168 170 inventory_removeIsNew: `[UNTRANSLATED] Remove New Equipment Exclamation Icon`,
169 171
170 quests_list: `Misiones`,
171 quests_completeAll: `Completar todas las misiones`,
172 quests_resetAll: `Reiniciar todas las misiones`,
173 quests_giveAll: `Otorgar todas las misiones`,
174
175 172 currency_RegularCredits: `Créditos`,
176 173 currency_PremiumCredits: `Platino`,
177 174 currency_FusionPoints: `Endo`,
Modified static/webui/translations/fr.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `Inventaire`,
133 133 navbar_guildView: `Clan`,
134 134 navbar_mods: `Mods`,
135 navbar_quests: `Quêtes`,
136 135 navbar_cheats: `Cheats`,
137 136 navbar_import: `Importer`,
138 137 settings_passwordMismatch: `Les mots de passe ne correspondent pas.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `K-Drives`,
158 157 inventory_moaPets: `Moas`,
159 158 inventory_kubrowPets: `Bêtes`,
159 inventory_questKeys: `Quêtes`,
160 160 inventory_evolutionProgress: `Progrès de l'évolution Incarnon`,
161 161 inventory_boosters: `Boosters`,
162 162 inventory_flavourItems: `<abbr title="Animation Sets, Glyphs, Palettes, etc.">Collectables</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `Ajouter manquant`,
166 166 inventory_bulkRankUp: `Tout rang max`,
167 167 inventory_bulkRemove: `Tout retirer`,
168 inventory_bulkComplete: `[UNTRANSLATED] Complete All`,
169 inventory_bulkReset: `[UNTRANSLATED] Reset All`,
168 170 inventory_removeIsNew: `Supprimer "!" sur les nouveaux équipements`,
169 171
170 quests_list: `Quêtes`,
171 quests_completeAll: `Compléter toutes les quêtes`,
172 quests_resetAll: `Réinitialiser toutes les quêtes`,
173 quests_giveAll: `Obtenir toutes les quêtes`,
174
175 172 currency_RegularCredits: `Crédits`,
176 173 currency_PremiumCredits: `Platinum`,
177 174 currency_FusionPoints: `Endo`,
Modified static/webui/translations/ru.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `Инвентарь`,
133 133 navbar_guildView: `Клан`,
134 134 navbar_mods: `Моды`,
135 navbar_quests: `Квесты`,
136 135 navbar_cheats: `Читы`,
137 136 navbar_import: `Импорт`,
138 137 settings_passwordMismatch: `[UNTRANSLATED] The new passwords do not match.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `К-Драйвы`,
158 157 inventory_moaPets: `МОА`,
159 158 inventory_kubrowPets: `Звери`,
159 inventory_questKeys: `[UNTRANSLATED] Quests`,
160 160 inventory_evolutionProgress: `Прогресс эволюции Инкарнонов`,
161 161 inventory_boosters: `Бустеры`,
162 162 inventory_flavourItems: `<abbr title="Наборы анимаций, глифы, палитры и т. д.">Уникальные предметы</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `Добавить отсутствующие`,
166 166 inventory_bulkRankUp: `Макс. ранг всего`,
167 167 inventory_bulkRemove: `Удалить все`,
168 inventory_bulkComplete: `Завершить все`,
169 inventory_bulkReset: `Сбросить прогресс всего`,
168 170 inventory_removeIsNew: `Удалить значок восклицательного знака нового снаряжения`,
169 171
170 quests_list: `Квесты`,
171 quests_completeAll: `Завершить все квесты`,
172 quests_resetAll: `Сбросить прогресс всех квестов`,
173 quests_giveAll: `Выдать все квесты`,
174
175 172 currency_RegularCredits: `Кредиты`,
176 173 currency_PremiumCredits: `Платина`,
177 174 currency_FusionPoints: `Эндо`,
Modified static/webui/translations/uk.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `Спорядження`,
133 133 navbar_guildView: `Клан`,
134 134 navbar_mods: `Модифікатори`,
135 navbar_quests: `Пригоди`,
136 135 navbar_cheats: `Чити`,
137 136 navbar_import: `Імпорт`,
138 137 settings_passwordMismatch: `[UNTRANSLATED] The new passwords do not match.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `К-Драйви`,
158 157 inventory_moaPets: `МОА`,
159 158 inventory_kubrowPets: `Тварини`,
159 inventory_questKeys: `Пригоди`,
160 160 inventory_evolutionProgress: `Прогрес еволюції Інкарнонів`,
161 161 inventory_boosters: `Посилення`,
162 162 inventory_flavourItems: `<abbr title="Набори анімацій, гліфи, палітри і т. д.">Унікальні предмети</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `[UNTRANSLATED] Add Missing`,
166 166 inventory_bulkRankUp: `[UNTRANSLATED] Max Rank All`,
167 167 inventory_bulkRemove: `[UNTRANSLATED] Remove all`,
168 inventory_bulkComplete: `[UNTRANSLATED] Complete All`,
169 inventory_bulkReset: `[UNTRANSLATED] Reset All`,
168 170 inventory_removeIsNew: `Видалити значок вигуку нового обладнання`,
169 171
170 quests_list: `Пригоди`,
171 quests_completeAll: `Закінчити всі пригоди`,
172 quests_resetAll: `Скинути прогрес всіх пригод`,
173 quests_giveAll: `Видати всі пригоди`,
174
175 172 currency_RegularCredits: `Кредити`,
176 173 currency_PremiumCredits: `Платина`,
177 174 currency_FusionPoints: `Ендо`,
Modified static/webui/translations/zh.js +3 -6
@@ -132,7 +132,6 @@ dict = {
132 132 navbar_inventory: `仓库`,
133 133 navbar_guildView: `氏族`,
134 134 navbar_mods: `Mods`,
135 navbar_quests: `系列任务`,
136 135 navbar_cheats: `作弊选项`,
137 136 navbar_import: `导入`,
138 137 settings_passwordMismatch: `新密码不匹配.`,
@@ -157,6 +156,7 @@ dict = {
157 156 inventory_hoverboards: `K式悬浮板`,
158 157 inventory_moaPets: `恐鸟`,
159 158 inventory_kubrowPets: `动物同伴`,
159 inventory_questKeys: `系列任务`,
160 160 inventory_evolutionProgress: `灵化之源进度`,
161 161 inventory_boosters: `加成器`,
162 162 inventory_flavourItems: `<abbr title="动作表情,浮印,调色板等">装饰物品</abbr>`,
@@ -165,13 +165,10 @@ dict = {
165 165 inventory_bulkAdd: `添加缺失物品`,
166 166 inventory_bulkRankUp: `全部升至满级`,
167 167 inventory_bulkRemove: `移除全部`,
168 inventory_bulkComplete: `[UNTRANSLATED] Complete All`,
169 inventory_bulkReset: `[UNTRANSLATED] Reset All`,
168 170 inventory_removeIsNew: `移除所有新装备上的感叹号图标`,
169 171
170 quests_list: `系列任务`,
171 quests_completeAll: `完成所有任务`,
172 quests_resetAll: `重置所有任务`,
173 quests_giveAll: `授予所有任务`,
174
175 172 currency_RegularCredits: `现金`,
176 173 currency_PremiumCredits: `白金`,
177 174 currency_FusionPoints: `内融核心`,