fix:道具栏和楼传界面的一些小bug

This commit is contained in:
ShakeFlower 2025-07-26 23:06:42 +08:00
parent b2c8d28d5a
commit 3315948b18
2 changed files with 36 additions and 36 deletions

View File

@ -2595,8 +2595,6 @@ ui.prototype.drawFly = function (page) {
core.fillText('ui', isHide ? '[显示本层]' : '[隐藏本层]', 60, 80, '#EEEEEE', this._buildFont(12, false));
core.fillText('ui', '[显示隐藏层:' + (noHideFly ? 'ON' : 'OFF') + ']', 160, 80, '#EEEEEE', this._buildFont(12, false));
core.fillText('ui', '[楼层笔记]', 260, 80, '#EEEEEE', this._buildFont(12, false));
var middle = this.HPIXEL + 39;
// 换行
@ -2629,20 +2627,20 @@ ui.prototype.drawFly = function (page) {
const blockCounts = getFloorBlockCounts(floorId);
if (blockCounts.enemy > 0) {
core.drawIcon('ui', 'greenSlime', this.PIXEL - 90, 100, 16, 16);
core.drawIcon('ui', 'redSlime', this.PIXEL - 85, 105, 16, 16);
core.fillText('ui', '× ' + blockCounts.enemy, this.PIXEL - 50, 117, 'white', '12px Verdana');
core.drawIcon('ui', 'greenSlime', this.PIXEL - 90, 30, 16, 16);
core.drawIcon('ui', 'redSlime', this.PIXEL - 85, 35, 16, 16);
core.fillText('ui', '× ' + blockCounts.enemy, this.PIXEL - 50, 47, 'white', '12px Verdana');
}
if (blockCounts.item > 0) {
core.drawIcon('ui', 'redGem', this.PIXEL - 90, 130, 16, 16);
core.drawIcon('ui', 'bluePotion', this.PIXEL - 85, 135, 16, 16);
core.fillText('ui', '× ' + blockCounts.item, this.PIXEL - 50, 147, 'white', '12px Verdana');
core.drawIcon('ui', 'redGem', this.PIXEL - 90, 60, 16, 16);
core.drawIcon('ui', 'bluePotion', this.PIXEL - 85, 65, 16, 16);
core.fillText('ui', '× ' + blockCounts.item, this.PIXEL - 50, 77, 'white', '12px Verdana');
}
if (blockCounts.npc > 0) {
core.drawIcon('ui', 'man', this.PIXEL - 90, 160, 16, 16);
core.drawIcon('ui', 'trader', this.PIXEL - 85, 165, 16, 16);
core.fillText('ui', '× ' + blockCounts.npc, this.PIXEL - 50, 177, 'white', '12px Verdana');
core.drawIcon('ui', 'man', this.PIXEL - 90, 90, 16, 16);
core.drawIcon('ui', 'trader', this.PIXEL - 85, 95, 16, 16);
core.fillText('ui', '× ' + blockCounts.npc, this.PIXEL - 50, 107, 'white', '12px Verdana');
}
}

View File

@ -2942,7 +2942,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
const callback = function () {
UI.redraw();
[UI._equipSlots, UI._equipInv, UI._itemInfo].forEach((menu) => {
if (menu && menu.onDraw) menu.drawContent();
});
core.ui.closePanel();
const next = core.status.replay.toReplay[0] || "";
if (!next.startsWith('equip:') && !next.startsWith('unEquip:')) {
@ -2978,7 +2980,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 复写control.startReplay
const oriStartReplay = core.control.startReplay; // 进入播放录像模式时清空道具栏选中目标的缓存
core.control.startReplay = function (list) {
UI.clearItemBoxCache();
clearItemBoxCache();
oriStartReplay.apply(core.control, [list, ...arguments]);
}
@ -3250,7 +3252,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (core.material.items[itemId]) itemInv.triggerItem();
} else if (selectType === "equipBox") {
equipChangeBoard.triggerItem();
UI.redraw();
[UI._equipSlots, UI._equipInv, UI._itemInfo].forEach((menu) => {
if (menu && menu.onDraw) menu.drawContent();
});
} else {
itemInv.setIndex(0);
}
@ -3779,8 +3783,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
/** @param {string} itemId */
function hotkeySelectFactory(itemId) {
const hotkeySelect = new HotkeySelect(itemId, 60, 100, 296, 206, 141); // 应当比物品背包的选择光标大,遮盖住前者
/** @type {[string, ButtonBaseClass][]} */
const btnMap = [];
const setHotkeyNum = function (i) {
const num = this.key.replace('btn', '');
hotkeySelect.setHotkey(num);
@ -3798,7 +3800,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
let btn;
if (row === 1) btn = new IconBtn(leftMargin + i * (btnSize + btnInterval), 100, btnSize, btnSize, 'btn' + num, style);
else btn = new IconBtn(leftMargin + (i - 5) * (btnSize + btnInterval), 150, btnSize, btnSize, 'btn' + num, style);
hotkeySelect.registerBtn('btn' + num, btn, () => setHotkeyNum(i));
hotkeySelect.registerBtn('btn' + num, btn, () => setHotkeyNum.call(btn, i));
}
const setNullBtn = new SetNullBtn(leftMargin + 4 * (btnSize + btnInterval), 150, btnSize, btnSize);
hotkeySelect.registerBtn('setNullBtn', setNullBtn, () => {
@ -3937,7 +3939,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const setHotkeyBtn = new IconBtn(145, 60, 24, 24, 'keyboard');
this.itemInfo.registerBtn('setHotkeyBtn', setHotkeyBtn, () => {
if (!UI.itemId) return;
[UI.back, UI.itemInv, UI.equipSlots, UI.itemInfo].forEach((menu) => {
[UI._back, UI.itemInv, UI._equipSlots, UI._itemInfo].forEach((menu) => {
if (menu) menu.endListen();
});
const hotkeySelect = hotkeySelectFactory(UI.itemId);