完善定点查看

This commit is contained in:
AncTe committed 2023-01-06 22:42:46 +08:00
1 parent 2cfbe4984f
commit 77d051dd27
8 files changed
+38 -16

No files matched your search

+4 -2
View File
@@ -9,10 +9,12 @@ const show = debounce((ev: MouseEvent) => {
if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY];
const [x, y] = flags.mouseLoc;
const e = core.getBlockId(x, y);
const mx = Math.round(x + core.bigmap.offsetX / 32);
const my = Math.round(y + core.bigmap.offsetY / 32);
const e = core.getBlockId(mx, my);
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, x, y);
const detail = getDetailedEnemy(enemy, mx, my);
core.plugin.bookDetailEnemy = detail;
showFixed.value = true;
}, 200);