HumanBreak/src/ui/fixedDetail.vue

43 lines
928 B
Vue
Raw Normal View History

2023-01-06 22:18:33 +08:00
<template>
<div id="fixed-detail">
2023-01-08 22:59:39 +08:00
<BookDetail
:from-book="false"
:default-panel="panel"
@close="close"
></BookDetail>
2023-01-06 22:18:33 +08:00
</div>
</template>
<script lang="ts" setup>
import { getDetailedEnemy, getLocFromMouseLoc } from '../plugin/ui/fixed';
2023-01-06 22:18:33 +08:00
import BookDetail from './bookDetail.vue';
import { detailInfo } from '../plugin/ui/book';
2023-01-06 22:18:33 +08:00
2023-01-08 22:59:39 +08:00
const panel = core.plugin.fixedDetailPanel ?? 'special';
detailInfo.pos = 0;
2023-01-06 22:18:33 +08:00
2023-01-06 23:00:38 +08:00
const [x, y] = flags.mouseLoc;
const [mx, my] = getLocFromMouseLoc(x, y);
const enemy = core.status.thisMap.enemy.list.find(v => {
return v.x === mx && v.y === my;
});
if (enemy) {
const detail = getDetailedEnemy(enemy);
detailInfo.enemy = detail;
2023-01-06 23:00:38 +08:00
} else {
close();
}
function close() {
2023-08-01 12:22:05 +08:00
ancTe.plugin.ui.fixedDetailOpened.value = false;
2023-01-06 23:00:38 +08:00
}
2023-01-06 22:18:33 +08:00
</script>
<style lang="less" scoped>
#fixed-detail {
width: 80%;
height: 100%;
}
</style>