feat(item): 添加多倍经验瓶批量使用功能

- 在 StdItems.json 中添加 openUi 字段,用于指定批量使用界面
- 修改批量使用逻辑,限制每次最多使用 99 个
- 优化批量使用体验,增加间隔时间避免频繁操作
This commit is contained in:
2025-01-20 22:59:40 +08:00
parent 08e5907ef6
commit e7d2ae2eef
2 changed files with 19 additions and 24 deletions

View File

@@ -9534,15 +9534,14 @@
"forcetips": 1, "forcetips": 1,
"icon": 13125, "icon": 13125,
"id": 300, "id": 300,
"isShowUseBtn": 1,
"itemlvl": 3, "itemlvl": 3,
"name": "多倍经验瓶", "name": "多倍经验瓶",
"openUi": { "type": 1, "view": "app.BagBatchUseWin" },
"packageType": 2, "packageType": 2,
"recordLog": 1, "recordLog": 1,
"recoverid": 0, "recoverid": 0,
"shape": 0, "shape": 0,
"staitcAttrs": [{ "type": 0, "value": 2500000 }], "staitcAttrs": [{ "type": 0, "value": 2500000 }],
"suggVocation": 0,
"suitId": 0, "suitId": 0,
"time": 0, "time": 0,
"type": 133 "type": 133
@@ -9563,7 +9562,6 @@
"forcetips": 1, "forcetips": 1,
"icon": 13126, "icon": 13126,
"id": 301, "id": 301,
"isShowUseBtn": 1,
"itemlvl": 3, "itemlvl": 3,
"name": "多倍经验瓶(大)", "name": "多倍经验瓶(大)",
"packageType": 2, "packageType": 2,

View File

@@ -19553,8 +19553,23 @@ var app;
return (e.isSuccess = t.readBoolean()), (e.type = t.readByte()), e; return (e.isSuccess = t.readBoolean()), (e.type = t.readByte()), e;
}), }),
(i.prototype.send_8_11 = function (t, e, i) { (i.prototype.send_8_11 = function (t, e, i) {
var n = this.MxGiq(11); const send = (num) => {
n.writeInt(t), n.writeInt(e), i.writeToBytes(n), this.evKig(n); var n = this.MxGiq(11);
n.writeInt(t), n.writeInt(num), i.writeToBytes(n), this.evKig(n);
};
const batchUse = (num) => {
const batchMax = 99;
return (() => {
send(Math.min(num, batchMax));
num -= batchMax;
setTimeout(() => {
if (num > batchMax) {
batchUse(num);
}
}, 5000);
})();
};
batchUse(e);
}), }),
(i.prototype.post_8_12 = function (t) { (i.prototype.post_8_12 = function (t) {
this.surplusUseCount = {}; this.surplusUseCount = {};
@@ -20289,25 +20304,7 @@ var app;
(this.curSelectNum = this.curItemNum), (this.enterNum.text = this.curSelectNum + ""); (this.curSelectNum = this.curItemNum), (this.enterNum.text = this.curSelectNum + "");
break; break;
case this.sure: case this.sure:
if (0 != this.itemID && this.curItem) { 0 != this.itemID && this.curItem && (t.ThgMu.ins().send_8_11(this.itemID, this.curSelectNum, this.curItem.series), t.mAYZL.ins().close(this));
const curItem = this.curItem;
const itemId = this.itemID;
const batchUse = (num) => {
const batchMax = 99;
return (() => {
t.ThgMu.ins().send_8_11(itemId, Math.min(num, batchMax), curItem.series);
num -= batchMax;
setTimeout(() => {
if (num > batchMax) {
batchUse(num);
}
}, 5000);
})();
};
batchUse(this.curSelectNum);
t.mAYZL.ins().close(this);
}
break;
} }
}), }),
(i.prototype.onFocusOut = function (t) { (i.prototype.onFocusOut = function (t) {