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): say "successfully removed" when using a negative quantity (#1271)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1271

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

代码差异

2 个文件 +20 -12
Modified static/webui/script.js +19 -12
@@ -812,20 +812,27 @@ function doAcquireMiscItems() {
812 812 $("#miscitem-type").addClass("is-invalid").focus();
813 813 return;
814 814 }
815 revalidateAuthz(() => {
816 $.post({
817 url: "/custom/addItems?" + window.authz,
818 contentType: "application/json",
819 data: JSON.stringify([
820 {
821 ItemType: uniqueName,
822 ItemCount: parseInt($("#miscitem-count").val())
815 const count = parseInt($("#miscitem-count").val());
816 if (count != 0) {
817 revalidateAuthz(() => {
818 $.post({
819 url: "/custom/addItems?" + window.authz,
820 contentType: "application/json",
821 data: JSON.stringify([
822 {
823 ItemType: uniqueName,
824 ItemCount: count
825 }
826 ])
827 }).done(function () {
828 if (count > 0) {
829 toast(loc("code_succAdded"));
830 } else {
831 toast(loc("code_succRemoved"));
823 832 }
824 ])
825 }).done(function () {
826 toast(loc("code_succAdded"));
833 });
827 834 });
828 });
835 }
829 836 }
830 837
831 838 function doAcquireRiven() {
Modified static/webui/translations/en.js +1 -0
@@ -28,6 +28,7 @@ dict = {
28 28 code_succRankUp: `Successfully ranked up.`,
29 29 code_noEquipmentToRankUp: `No equipment to rank up.`,
30 30 code_succAdded: `Successfully added.`,
31 code_succRemoved: `Successfully removed.`,
31 32 code_buffsNumber: `Number of buffs`,
32 33 code_cursesNumber: `Number of curses`,
33 34 code_rerollsNumber: `Number of rerolls`,