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

chore(webui): allow negative quantity for "add items" & "add mods" (#1113)

Closes #1111 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1113 Co-authored-by: Sainan <sainan@calamity.inc> Co-committed-by: Sainan <sainan@calamity.inc>

ec1f504b
Sainan <sainan@calamity.inc>
提交于

代码差异

2 个文件 +5 -2
Modified src/services/inventoryService.ts +3 -0
@@ -284,6 +284,9 @@ export const addItem = async (
284 284 };
285 285 } else if (ExportResources[typeName].productCategory == "KubrowPetEggs") {
286 286 const changes: IKubrowPetEggClient[] = [];
287 if (quantity < 0) {
288 throw new Error(`removal of KubrowPetEggs not handled`);
289 }
287 290 for (let i = 0; i != quantity; ++i) {
288 291 const egg: IKubrowPetEggDatabase = {
289 292 ItemType: "/Lotus/Types/Game/KubrowPet/Eggs/KubrowEgg",
Modified static/webui/index.html +2 -2
@@ -89,7 +89,7 @@
89 89 <div class="card mb-3">
90 90 <h5 class="card-header" data-loc="inventory_addItems"></h5>
91 91 <form class="card-body input-group" onsubmit="doAcquireMiscItems();return false;">
92 <input class="form-control" id="miscitem-count" type="number" min="1" value="1" />
92 <input class="form-control" id="miscitem-count" type="number" value="1" />
93 93 <input class="form-control w-50" id="miscitem-type" list="datalist-miscitems" />
94 94 <button class="btn btn-primary" type="submit" data-loc="general_addButton"></button>
95 95 </form>
@@ -392,7 +392,7 @@
392 392 <h5 class="card-header" data-loc="mods_mods"></h5>
393 393 <div class="card-body">
394 394 <form class="input-group mb-3" onsubmit="doAcquireMod();return false;">
395 <input class="form-control" id="mod-count" type="number" min="1" value="1"/>
395 <input class="form-control" id="mod-count" type="number" value="1"/>
396 396 <input class="form-control w-50" id="mod-to-acquire" list="datalist-mods" />
397 397 <button class="btn btn-primary" type="submit" data-loc="general_addButton"></button>
398 398 </form>