feat(item): 添加多倍经验瓶批量使用功能
- 在 StdItems.json 中添加 openUi 字段,用于指定批量使用界面 - 修改批量使用逻辑,限制每次最多使用 99 个 - 优化批量使用体验,增加间隔时间避免频繁操作
This commit is contained in:
@@ -9534,15 +9534,14 @@
|
||||
"forcetips": 1,
|
||||
"icon": 13125,
|
||||
"id": 300,
|
||||
"isShowUseBtn": 1,
|
||||
"itemlvl": 3,
|
||||
"name": "多倍经验瓶",
|
||||
"openUi": { "type": 1, "view": "app.BagBatchUseWin" },
|
||||
"packageType": 2,
|
||||
"recordLog": 1,
|
||||
"recoverid": 0,
|
||||
"shape": 0,
|
||||
"staitcAttrs": [{ "type": 0, "value": 2500000 }],
|
||||
"suggVocation": 0,
|
||||
"suitId": 0,
|
||||
"time": 0,
|
||||
"type": 133
|
||||
@@ -9563,7 +9562,6 @@
|
||||
"forcetips": 1,
|
||||
"icon": 13126,
|
||||
"id": 301,
|
||||
"isShowUseBtn": 1,
|
||||
"itemlvl": 3,
|
||||
"name": "多倍经验瓶(大)",
|
||||
"packageType": 2,
|
||||
|
||||
@@ -19553,8 +19553,23 @@ var app;
|
||||
return (e.isSuccess = t.readBoolean()), (e.type = t.readByte()), e;
|
||||
}),
|
||||
(i.prototype.send_8_11 = function (t, e, i) {
|
||||
const send = (num) => {
|
||||
var n = this.MxGiq(11);
|
||||
n.writeInt(t), n.writeInt(e), i.writeToBytes(n), this.evKig(n);
|
||||
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) {
|
||||
this.surplusUseCount = {};
|
||||
@@ -20289,25 +20304,7 @@ var app;
|
||||
(this.curSelectNum = this.curItemNum), (this.enterNum.text = this.curSelectNum + "");
|
||||
break;
|
||||
case this.sure:
|
||||
if (0 != this.itemID && this.curItem) {
|
||||
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;
|
||||
0 != this.itemID && this.curItem && (t.ThgMu.ins().send_8_11(this.itemID, this.curSelectNum, this.curItem.series), t.mAYZL.ins().close(this));
|
||||
}
|
||||
}),
|
||||
(i.prototype.onFocusOut = function (t) {
|
||||
|
||||
Reference in New Issue
Block a user