修复定点查看的bug

This commit is contained in:
unanmed 2023-01-06 23:00:38 +08:00
parent c4e746a211
commit 5379dc99e6

View File

@ -11,20 +11,21 @@ import BookDetail from './bookDetail.vue';
core.plugin.bookDetailPos = 0;
function close() {
core.plugin.fixedDetailOpened.value = false;
}
onMounted(() => {
const [x, y] = flags.mouseLoc;
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;
if (e && core.getClsFromId(e)?.startsWith('enemy')) {
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, mx, my);
core.plugin.bookDetailEnemy = detail;
});
} else {
close();
}
function close() {
core.plugin.fixedDetailOpened.value = false;
}
</script>
<style lang="less" scoped>