完善定点查看

This commit is contained in:
AncTe committed 2023-01-08 22:59:39 +08:00
1 parent 5379dc99e6
commit 1911caa9c4
15 files changed
+132 -59

No files matched your search

+9 -4
View File
@@ -139,7 +139,7 @@
"condition": "true",
"desc": [
"这里包含本塔中所有的快捷键。对于手机端,可以点击工具栏的难度的位置切换工具栏至数字键。",
"下面会分为样板快捷键和本塔快捷键两类。",
"下面会分为样板快捷键和本塔快捷键两类分别说明。",
"<br>",
"<br>",
"下面是样板中的所有快捷键:",
@@ -189,7 +189,9 @@
"<br>",
"<span style=\"color: gold\">H</span>:打开百科全书",
"<br>",
"<span style=\"color: gold\">K</span>:查看鼠标位置怪物的详细信息"
"<span style=\"color: gold\">E</span>:查看鼠标位置怪物的特殊属性信息",
"<br>",
"<span style=\"color: gold\">C</span>:查看鼠标位置怪物的详细临界信息"
]
},
"extraAttr": {
@@ -243,6 +245,7 @@
"本塔的状态栏的布局较为灵活。它是横向的布局,在状态栏较宽时可以看到,属性会横向依次显示。按照显示顺序,",
"状态栏显示项依次为:",
"<br>",
"<br>",
"1. 楼层名,点击后进入浏览地图界面",
"<br>",
"2. 勇士等级",
@@ -310,8 +313,10 @@
"本塔的怪物手册功能很多,下面一一介绍。",
"<br>",
"<br>",
"首先,你可以按X打开怪物手册。将鼠标移动到一个怪物上,按下<span style=\"color: gold\">",
"K键</span>,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"首先,你可以按X打开怪物手册。除此之外,将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"将鼠标移动到一个怪物上,按下<span style=\"color: gold\">",
"E键</span>,可以查看该怪物的特殊属性信息。按下<span style=\"color: gold\">",
"C键</span>,可以查看该怪物的详细临界信息。",
"<br>",
"<br>",
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",
+13 -7
View File
@@ -4,15 +4,15 @@ import { getDamageColor } from '../utils';
export const showFixed = ref(false);
const show = debounce((ev: MouseEvent) => {
let lastId: EnemyIds;
const show = debounce((ev: MouseEvent, mx: number, my: number, e: AllIds) => {
if (!window.flags) return;
if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY];
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 !== lastId) showFixed.value = false;
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
lastId = e as EnemyIds;
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, mx, my);
core.plugin.bookDetailEnemy = detail;
@@ -22,8 +22,14 @@ const show = debounce((ev: MouseEvent) => {
export default function init() {
const data = core.canvas.data.canvas;
data.addEventListener('mousemove', ev => {
showFixed.value = false;
show(ev);
if (!core.isPlaying()) return;
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 !== lastId) showFixed.value = false;
if (!e) return;
show(ev, mx, my, e);
});
return {
+1
View File
@@ -1,5 +1,6 @@
type FloorIds =
| 'empty'
| 'MT0'
| 'MT1'
| 'MT2'
+3
View File
@@ -136,6 +136,9 @@ interface PluginUis {
/** 怪物手册详细信息展示的怪物 */
bookDetailEnemy: DetailedEnemy;
/** 定点查看的界面,特殊属性还是临界 */
fixedDetailPanel: 'special' | 'critical';
/** ui是否使用渐变 */
readonly transition: Ref<boolean>;
+7 -6
View File
@@ -81,16 +81,17 @@ import { keycode } from '../plugin/utils';
import { sleep } from 'mutate-animate';
import EnemyTarget from '../panel/enemyTarget.vue';
const enemy = core.plugin.bookDetailEnemy;
const top = ref(core.plugin.bookDetailPos);
const panel = ref('special');
let detail: HTMLDivElement;
const props = defineProps<{
fromBook?: boolean;
defaultPanel?: 'special' | 'critical' | 'target';
}>();
const enemy = core.plugin.bookDetailEnemy;
const top = ref(core.plugin.bookDetailPos);
const panel = ref<string>(props.defaultPanel ?? 'special');
let detail: HTMLDivElement;
const emits = defineEmits<{
(e: 'close'): void;
}>();
+3
View File
@@ -80,6 +80,9 @@ async function calHeight() {
vw = window.innerWidth;
width.value = vh * 0.28;
await new Promise(res => requestAnimationFrame(res));
if (core.plugin.fixedDetailOpened.value) {
showFixed.value = false;
}
main = document.getElementById('enemy-fixed') as HTMLDivElement;
if (!main) return;
const style = getComputedStyle(main);
+7 -1
View File
@@ -1,6 +1,10 @@
<template>
<div id="fixed-detail">
<BookDetail :from-book="false" @close="close"></BookDetail>
<BookDetail
:from-book="false"
:default-panel="panel"
@close="close"
></BookDetail>
</div>
</template>
@@ -9,6 +13,8 @@ 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;
+11 -5
View File
@@ -102,19 +102,25 @@ function getName(id: EnemyIds) {
}
function getDamage(id: EnemyIds) {
return core.formatBigNumber(core.getDamageInfo(id)?.damage) ?? '???';
return (
core.formatBigNumber(
core.getDamageInfo(id, void 0, void 0, void 0, 'empty')?.damage
) ?? '???'
);
}
function getCritical(id: EnemyIds) {
return (
core.nextCriticals(id, 1)[0]?.map(v => core.formatBigNumber(v)) ?? [
0, 0
]
core
.nextCriticals(id, 1, void 0, void 0, 'empty')[0]
?.map(v => core.formatBigNumber(v)) ?? [0, 0]
);
}
function getDefDamage(id: EnemyIds) {
return core.formatBigNumber(core.getDefDamage(id, ratio));
return core.formatBigNumber(
core.getDefDamage(id, ratio, void 0, void 0, 'empty')
);
}
</script>