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

feat(webui): acquiring gear items via "Add Items" (#340)

c415fdd9
Sainan <sainan@calamity.gg>
提交于

代码差异

2 个文件 +21 -8
Modified src/controllers/custom/getItemListsController.ts +15 -3
@@ -1,7 +1,13 @@
1 1 import { RequestHandler } from "express";
2 2 import { MinItem, items, getEnglishString } from "@/src/services/itemDataService";
3 3 import badItems from "@/static/json/exclude-mods.json";
4 import { ExportArcanes, ExportResources, ExportWarframes, ExportWeapons } from "warframe-public-export-plus";
4 import {
5 ExportArcanes,
6 ExportGear,
7 ExportResources,
8 ExportWarframes,
9 ExportWeapons
10 } from "warframe-public-export-plus";
5 11
6 12 interface ListedItem {
7 13 uniqueName: string;
@@ -31,7 +37,7 @@ const getItemListsController: RequestHandler = (_req, res) => {
31 37 });
32 38 } else if (!item.excludeFromCodex) {
33 39 miscitems.push({
34 uniqueName,
40 uniqueName: "MiscItems:" + uniqueName,
35 41 name: getEnglishString(item.name)
36 42 });
37 43 }
@@ -39,7 +45,13 @@ const getItemListsController: RequestHandler = (_req, res) => {
39 45 }
40 46 for (const [uniqueName, item] of Object.entries(ExportResources)) {
41 47 miscitems.push({
42 uniqueName,
48 uniqueName: "MiscItems:" + uniqueName,
49 name: getEnglishString(item.name)
50 });
51 }
52 for (const [uniqueName, item] of Object.entries(ExportGear)) {
53 miscitems.push({
54 uniqueName: "Consumables:" + uniqueName,
43 55 name: getEnglishString(item.name)
44 56 });
45 57 }
Modified static/webui/script.js +6 -5
@@ -512,17 +512,18 @@ function disposeOfItems(category, type, count) {
512 512 }
513 513
514 514 function doAcquireMiscItems() {
515 const uniqueName = getKey(document.getElementById("miscitem-type"));
516 if (!uniqueName) {
515 const data = getKey(document.getElementById("miscitem-type"));
516 if (!data) {
517 517 $("#miscitem-type").addClass("is-invalid").focus();
518 518 return;
519 519 }
520 const [category, uniqueName] = data.split(":");
520 521 revalidateAuthz(() => {
521 522 $.post({
522 523 url: "/api/missionInventoryUpdate.php?" + window.authz,
523 524 contentType: "text/plain",
524 525 data: JSON.stringify({
525 MiscItems: [
526 [category]: [
526 527 {
527 528 ItemType: uniqueName,
528 529 ItemCount: parseInt($("#miscitem-count").val())
@@ -535,8 +536,8 @@ function doAcquireMiscItems() {
535 536 });
536 537 }
537 538
538 $("#miscitem-name").on("input", () => {
539 $("#miscitem-name").removeClass("is-invalid");
539 $("#miscitem-type").on("input", () => {
540 $("#miscitem-type").removeClass("is-invalid");
540 541 });
541 542
542 543 function doAcquireRiven() {