mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 20:59:37 +08:00
43 lines
1020 B
Vue
43 lines
1020 B
Vue
<template>
|
|
<div id="fixed-detail">
|
|
<BookDetail
|
|
:from-book="false"
|
|
:default-panel="panel"
|
|
@close="close"
|
|
></BookDetail>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { onMounted, ref } from 'vue';
|
|
import { getDetailedEnemy } from '../plugin/ui/fixed';
|
|
import BookDetail from './bookDetail.vue';
|
|
|
|
const panel = core.plugin.fixedDetailPanel ?? 'special';
|
|
|
|
core.plugin.bookDetailPos = 0;
|
|
|
|
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')) {
|
|
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>
|
|
#fixed-detail {
|
|
width: 80%;
|
|
height: 100%;
|
|
}
|
|
</style>
|