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): echoes of umbra (#3019)

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

8088044e
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

11 个文件 +94 -0
Added src/controllers/custom/setUmbraEchoesController.ts +22 -0
@@ -0,0 +1,22 @@
1 import { getAccountIdForRequest } from "../../services/loginService.ts";
2 import { getInventory } from "../../services/inventoryService.ts";
3 import type { RequestHandler } from "express";
4 import { broadcastInventoryUpdate } from "../../services/wsService.ts";
5
6 export const setUmbraEchoesController: RequestHandler = async (req, res) => {
7 const accountId = await getAccountIdForRequest(req);
8 const request = req.body as ISetUmbraEchoesRequest;
9 const inventory = await getInventory(accountId, "Suits");
10 const suit = inventory.Suits.id(request.oid);
11 if (suit) {
12 suit.UmbraDate = request.UmbraDate ? new Date(request.UmbraDate) : undefined;
13 await inventory.save();
14 broadcastInventoryUpdate(req);
15 }
16 res.end();
17 };
18
19 interface ISetUmbraEchoesRequest {
20 oid: string;
21 UmbraDate: number;
22 }
Modified src/routes/custom.ts +2 -0
@@ -46,6 +46,7 @@ import { updateFingerprintController } from "../controllers/custom/updateFingerp
46 46 import { unlockLevelCapController } from "../controllers/custom/unlockLevelCapController.ts";
47 47 import { changeModularPartsController } from "../controllers/custom/changeModularPartsController.ts";
48 48 import { setInvigorationController } from "../controllers/custom/setInvigorationController.ts";
49 import { setUmbraEchoesController } from "../controllers/custom/setUmbraEchoesController.ts";
49 50 import { setAccountCheatController } from "../controllers/custom/setAccountCheatController.ts";
50 51 import { setGuildCheatController } from "../controllers/custom/setGuildCheatController.ts";
51 52
@@ -97,6 +98,7 @@ customRouter.post("/updateFingerprint", updateFingerprintController);
97 98 customRouter.post("/unlockLevelCap", unlockLevelCapController);
98 99 customRouter.post("/changeModularParts", changeModularPartsController);
99 100 customRouter.post("/setInvigoration", setInvigorationController);
101 customRouter.post("/setUmbraEchoes", setUmbraEchoesController);
100 102 customRouter.post("/setAccountCheat", setAccountCheatController);
101 103 customRouter.post("/setGuildCheat", setGuildCheatController);
102 104
Modified static/webui/index.html +16 -0
@@ -822,6 +822,22 @@
822 822 </form>
823 823 </div>
824 824 </div>
825 <div id="umbraEchoes-card" class="card mb-3 d-none">
826 <h5 class="card-header" data-loc="detailedView_umbraEchoesLabel"></h5>
827 <div class="card-body">
828 <p data-loc="detailedView_umbraEchoesDescription"></p>
829 <form onsubmit="submitUmbraEchoes(event)">
830 <div class="mb-3">
831 <label for="umbraEchoes-expiry" class="form-label" data-loc="detailedView_umbraEchoesExpiryLabel"></label>
832 <input type="datetime-local" class="form-control" max="2038-01-19T03:14" id="umbraEchoes-expiry" onblur="this.value=new Date(this.value)>new Date(this.max)?new Date(this.max).toISOString().slice(0,16):this.value"/>
833 </div>
834 <div class="d-flex gap-2">
835 <button type="submit" class="btn btn-primary" data-loc="general_setButton"></button>
836 <button type="button" class="btn btn-danger" onclick="setUmbraEchoes()" data-loc="code_remove"></button>
837 </div>
838 </form>
839 </div>
840 </div>
825 841 <div id="modularParts-card" class="card mb-3 d-none">
826 842 <h5 class="card-header" data-loc="detailedView_modularPartsLabel"></h5>
827 843 <div class="card-body">
Modified static/webui/script.js +26 -0
@@ -1652,6 +1652,12 @@ function updateInventory() {
1652 1652 formatDatetime("%Y-%m-%d %H:%M", Number(item.UpgradesExpiry?.$date.$numberLong)) || "";
1653 1653 }
1654 1654
1655 if (item.ItemType != "/Lotus/Powersuits/Excalibur/ExcaliburUmbra") {
1656 document.getElementById("umbraEchoes-card").classList.remove("d-none");
1657 document.getElementById("umbraEchoes-expiry").value =
1658 formatDatetime("%Y-%m-%d %H:%M", Number(item.UmbraDate?.$date.$numberLong)) || "";
1659 }
1660
1655 1661 {
1656 1662 document.getElementById("loadout-card").classList.remove("d-none");
1657 1663 const maxModConfigNum = Math.min(2 + (item.ModSlotPurchases ?? 0), 5);
@@ -3519,6 +3525,7 @@ single.getRoute("#detailedView-route").on("beforeload", function () {
3519 3525 document.getElementById("loadout-card").classList.add("d-none");
3520 3526 document.getElementById("archonShards-card").classList.add("d-none");
3521 3527 document.getElementById("edit-suit-invigorations-card").classList.add("d-none");
3528 document.getElementById("umbraEchoes-card").classList.add("d-none");
3522 3529 document.getElementById("modularParts-card").classList.add("d-none");
3523 3530 document.getElementById("modularParts-form").innerHTML = "";
3524 3531 document.getElementById("valenceBonus-card").classList.add("d-none");
@@ -4257,6 +4264,25 @@ function setInvigoration(data) {
4257 4264 });
4258 4265 }
4259 4266
4267 function submitUmbraEchoes(event) {
4268 event.preventDefault();
4269 const expiry = document.getElementById("umbraEchoes-expiry").value;
4270 setUmbraEchoes({
4271 UmbraDate: expiry ? new Date(expiry).getTime() : Date.now() + 1 * 24 * 60 * 60 * 1000
4272 });
4273 }
4274
4275 function setUmbraEchoes(data) {
4276 const oid = new URLSearchParams(window.location.search).get("itemId");
4277 $.post({
4278 url: "/custom/setUmbraEchoes?" + window.authz,
4279 contentType: "application/json",
4280 data: JSON.stringify({ oid, ...data })
4281 }).done(function () {
4282 updateInventory();
4283 });
4284 }
4285
4260 4286 function handleAbilityOverride(event, configIndex) {
4261 4287 event.preventDefault();
4262 4288 const urlParams = new URLSearchParams(window.location.search);
Modified static/webui/translations/de.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `Kräftigung`,
164 164 detailedView_loadoutLabel: `Loadouts`,
165 165 detailedView_equipmentFeaturesLabel: `[UNTRANSLATED] Equipment Features`,
166 detailedView_umbraEchoesLabel: `[UNTRANSLATED] Echoes Of Umbra`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200% Fähigkeitsstärke`,
168 169 invigorations_offensive_AbilityRange: `+100% Fähigkeitsreichweite`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `Fähigkeitsüberschreibung`,
194 195 abilityOverride_onSlot: `auf Slot`,
195 196
197 detailedView_umbraEchoesDescription: `Wird ein Warframe mit dieser Flüssigkeit injiziert, kann er selbstständig an der Seite des Operators kämpfen.`,
198 detailedView_umbraEchoesExpiryLabel: `[UNTRANSLATED] Echo Expiry (optional)`,
199
196 200 mods_addRiven: `Riven hinzufügen`,
197 201 mods_fingerprint: `Fingerabdruck`,
198 202 mods_fingerprintHelp: `Benötigst du Hilfe mit dem Fingerabdruck?`,
Modified static/webui/translations/en.js +4 -0
@@ -162,6 +162,7 @@ dict = {
162 162 detailedView_invigorationLabel: `Invigoration`,
163 163 detailedView_loadoutLabel: `Loadouts`,
164 164 detailedView_equipmentFeaturesLabel: `Equipment Features`,
165 detailedView_umbraEchoesLabel: `Echoes Of Umbra`,
165 166
166 167 invigorations_offensive_AbilityStrength: `+200% Ability Strength`,
167 168 invigorations_offensive_AbilityRange: `+100% Ability Range`,
@@ -192,6 +193,9 @@ dict = {
192 193 abilityOverride_label: `Ability Override`,
193 194 abilityOverride_onSlot: `on slot`,
194 195
196 detailedView_umbraEchoesDescription: `Injecting this fluid into a Warframe will imbue it with the ability to fight autonomously alongside the Operator.`,
197 detailedView_umbraEchoesExpiryLabel: `Echo Expiry (optional)`,
198
195 199 mods_addRiven: `Add Riven`,
196 200 mods_fingerprint: `Fingerprint`,
197 201 mods_fingerprintHelp: `Need help with the fingerprint?`,
Modified static/webui/translations/es.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `Fortalecimiento`,
164 164 detailedView_loadoutLabel: `Equipamientos`,
165 165 detailedView_equipmentFeaturesLabel: `[UNTRANSLATED] Equipment Features`,
166 detailedView_umbraEchoesLabel: `[UNTRANSLATED] Echoes Of Umbra`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200% Fuerza de Habilidad`,
168 169 invigorations_offensive_AbilityRange: `+100% Alcance de Habilidad`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `Intercambio de Habilidad`,
194 195 abilityOverride_onSlot: `en el espacio`,
195 196
197 detailedView_umbraEchoesDescription: `Inyectar este fluido en un warframe lo imbuirá con la capacidad para luchar autónomamente junto a su operador.`,
198 detailedView_umbraEchoesExpiryLabel: `[UNTRANSLATED] Echo Expiry (optional)`,
199
196 200 mods_addRiven: `Agregar Agrietado`,
197 201 mods_fingerprint: `Huella digital`,
198 202 mods_fingerprintHelp: `¿Necesitas ayuda con la huella digital?`,
Modified static/webui/translations/fr.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `Dynamisation`,
164 164 detailedView_loadoutLabel: `Équipements`,
165 165 detailedView_equipmentFeaturesLabel: `[UNTRANSLATED] Equipment Features`,
166 detailedView_umbraEchoesLabel: `[UNTRANSLATED] Echoes Of Umbra`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200% de puissance de pouvoir`,
168 169 invigorations_offensive_AbilityRange: `+100% de portée de pouvoir`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `Remplacement de pouvoir`,
194 195 abilityOverride_onSlot: `Sur l'emplacement`,
195 196
197 detailedView_umbraEchoesDescription: `L'injection de ce fluide dans une Warframe lui donnera la possibilité de se battre de manière autonome aux côtés de l'Opérateur.`,
198 detailedView_umbraEchoesExpiryLabel: `[UNTRANSLATED] Echo Expiry (optional)`,
199
196 200 mods_addRiven: `Ajouter un riven`,
197 201 mods_fingerprint: `Empreinte`,
198 202 mods_fingerprintHelp: `Besoin d'aide pour l'empreinte ?`,
Modified static/webui/translations/ru.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `Воодушевление`,
164 164 detailedView_loadoutLabel: `Конфигурации`,
165 165 detailedView_equipmentFeaturesLabel: `Модификаторы снаряжения`,
166 detailedView_umbraEchoesLabel: `Эхо Умбры`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200% к силе способностей.`,
168 169 invigorations_offensive_AbilityRange: `+100% к зоне поражения способностей.`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `Переопределение способности`,
194 195 abilityOverride_onSlot: `в ячейке`,
195 196
197 detailedView_umbraEchoesDescription: `Введение этой жидкости в варфрейм позволит ему автономно сражаться бок о бок с оператором.`,
198 detailedView_umbraEchoesExpiryLabel: `Срок действия Эха (необязательно)`,
199
196 200 mods_addRiven: `Добавить мод Разлома`,
197 201 mods_fingerprint: `Отпечаток`,
198 202 mods_fingerprintHelp: `Нужна помощь с отпечатком?`,
Modified static/webui/translations/uk.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `Зміцнення`,
164 164 detailedView_loadoutLabel: `Конфігурації`,
165 165 detailedView_equipmentFeaturesLabel: `[UNTRANSLATED] Equipment Features`,
166 detailedView_umbraEchoesLabel: `[UNTRANSLATED] Echoes Of Umbra`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200% до потужності здібностей.`,
168 169 invigorations_offensive_AbilityRange: `+100% до досяжності здібностей.`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `Перевизначення здібностей`,
194 195 abilityOverride_onSlot: `у комірці`,
195 196
197 detailedView_umbraEchoesDescription: `Рідина, яка після введення дозволяє ворфрейму використовувати єдність і битися самостійно пліч-о-пліч з оператором.`,
198 detailedView_umbraEchoesExpiryLabel: `[UNTRANSLATED] Echo Expiry (optional)`,
199
196 200 mods_addRiven: `Добавити модифікатор Розколу`,
197 201 mods_fingerprint: `Відбиток`,
198 202 mods_fingerprintHelp: `Потрібна допомога з відбитком?`,
Modified static/webui/translations/zh.js +4 -0
@@ -163,6 +163,7 @@ dict = {
163 163 detailedView_invigorationLabel: `活化`,
164 164 detailedView_loadoutLabel: `配置`,
165 165 detailedView_equipmentFeaturesLabel: `[UNTRANSLATED] Equipment Features`,
166 detailedView_umbraEchoesLabel: `[UNTRANSLATED] Echoes Of Umbra`,
166 167
167 168 invigorations_offensive_AbilityStrength: `+200%技能强度`,
168 169 invigorations_offensive_AbilityRange: `+100%技能范围`,
@@ -193,6 +194,9 @@ dict = {
193 194 abilityOverride_label: `技能替换`,
194 195 abilityOverride_onSlot: `槽位`,
195 196
197 detailedView_umbraEchoesDescription: `将这种液体注入战甲内,使其具有与指挥官并肩作战的能力。`,
198 detailedView_umbraEchoesExpiryLabel: `[UNTRANSLATED] Echo Expiry (optional)`,
199
196 200 mods_addRiven: `添加裂罅MOD`,
197 201 mods_fingerprint: `印记`,
198 202 mods_fingerprintHelp: `需要印记相关的帮助?`,