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): add "Remove" option for owned warframes & weapons (#172)

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

代码差异

1 个文件 +40 -0
Modified static/webui/script.js +40 -0
@@ -83,6 +83,16 @@ function updateInventory() {
83 83 };
84 84 a.textContent = "Make Rank 30";
85 85 td.appendChild(a);
86 td.innerHTML += " &middot; ";
87 }
88 {
89 const a = document.createElement("a");
90 a.href = "#";
91 a.onclick = function () {
92 disposeOfGear("Suits", item.ItemId.$oid);
93 };
94 a.textContent = "Remove";
95 td.appendChild(a);
86 96 }
87 97 tr.appendChild(td);
88 98 }
@@ -109,6 +119,16 @@ function updateInventory() {
109 119 };
110 120 a.textContent = "Make Rank 30";
111 121 td.appendChild(a);
122 td.innerHTML += " &middot; ";
123 }
124 {
125 const a = document.createElement("a");
126 a.href = "#";
127 a.onclick = function () {
128 disposeOfGear(category, item.ItemId.$oid);
129 };
130 a.textContent = "Remove";
131 td.appendChild(a);
112 132 }
113 133 tr.appendChild(td);
114 134 }
@@ -197,3 +217,23 @@ function addGearExp(category, oid, xp) {
197 217 updateInventory();
198 218 });
199 219 }
220
221 function disposeOfGear(category, oid) {
222 const data = {
223 SellCurrency: "SC_RegularCredits",
224 SellPrice: 0,
225 Items: {}
226 };
227 data.Items[category] = [
228 {
229 String: oid
230 }
231 ];
232 $.post({
233 url: "/api/sell.php?accountId=" + window.accountId,
234 contentType: "text/plain",
235 data: JSON.stringify(data)
236 }).done(function () {
237 updateInventory();
238 });
239 }