mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
修复定点查看的bug
This commit is contained in:
parent
c4e746a211
commit
5379dc99e6
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user