diff --git a/public/project/functions.js b/public/project/functions.js index 896094a..2a5bac1 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -1190,6 +1190,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { return; } + const [x, y] = flags.mouseLoc; + const mx = Math.round(x + core.bigmap.offsetX / 32); + const my = Math.round(y + core.bigmap.offsetY / 32); + // 根据keyCode值来执行对应操作 switch (keyCode) { case 74: // J:打开技能树 @@ -1248,17 +1252,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { core.useItem('I560', true); break; case 75: // J:定点查看 - if ( - core.getBlockCls(...flags.mouseLoc)?.startsWith('enemy') - ) { + if (core.getBlockCls(mx, my)?.startsWith('enemy')) { core.plugin.showFixed.value = false; core.plugin.fixedDetailOpened.value = true; } break; case 77: // M:快速标记 - const [x, y] = flags.mouseLoc; - const mx = Math.round(x + core.bigmap.offsetX / 32); - const my = Math.round(y + core.bigmap.offsetY / 32); const blocks = core.getMapBlocksObj(); const block = blocks[`${mx},${my}`]; if (block.event.cls.startsWith('enemy')) { diff --git a/src/data/desc.json b/src/data/desc.json index 0664506..18881ee 100644 --- a/src/data/desc.json +++ b/src/data/desc.json @@ -310,6 +310,10 @@ "本塔的怪物手册功能很多,下面一一介绍。", "
", "
", + "首先,你可以按X打开怪物手册。将鼠标移动到一个怪物上,按下", + "K键,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。", + "
", + "
", "怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。", "
", "
", diff --git a/src/data/settings.json b/src/data/settings.json index e7c03d3..5498f32 100644 --- a/src/data/settings.json +++ b/src/data/settings.json @@ -37,7 +37,7 @@ "useFixed": { "text": "移动鼠标显示怪物信息", "desc": [ - "开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。", + "开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。手机端此功能无效。", "
", "
", "注:当鼠标移动到怪物上时,经过200毫秒才会显示信息,防止误操作。" diff --git a/src/panel/enemyCritical.vue b/src/panel/enemyCritical.vue index 546f2d0..2fe3773 100644 --- a/src/panel/enemyCritical.vue +++ b/src/panel/enemyCritical.vue @@ -104,6 +104,12 @@ const ceil = Math.ceil; const x = ref(props.fromBook ? void 0 : flags.mouseLoc[0]); const y = ref(props.fromBook ? void 0 : flags.mouseLoc[1]); +x.value = has(x.value) + ? Math.round(x.value + core.bigmap.offsetX / 32) + : void 0; +y.value = has(y.value) + ? Math.round(y.value + core.bigmap.offsetY / 32) + : void 0; let originCri = getCriticalDamage(enemy, 0, 0, x.value, y.value); let originDef = getDefDamage(enemy, 0, 0, x.value, y.value); @@ -185,8 +191,6 @@ function generateData(data: [number, number][]): ChartConfiguration['data'] { } const update = debounce((atk: Chart, def: Chart) => { - x.value = props.fromBook ? void 0 : flags.mouseLoc[0]; - y.value = props.fromBook ? void 0 : flags.mouseLoc[1]; allCri.value = getCriticalDamage( enemy, addAtk.value * ratio, diff --git a/src/panel/enemySpecial.vue b/src/panel/enemySpecial.vue index 3b3d576..ce5bf10 100644 --- a/src/panel/enemySpecial.vue +++ b/src/panel/enemySpecial.vue @@ -35,12 +35,21 @@ diff --git a/src/plugin/ui/fixed.ts b/src/plugin/ui/fixed.ts index 0c5cfb9..f770ece 100644 --- a/src/plugin/ui/fixed.ts +++ b/src/plugin/ui/fixed.ts @@ -9,10 +9,12 @@ const show = debounce((ev: MouseEvent) => { if (!flags.mouseLoc) return; flags.clientLoc = [ev.clientX, ev.clientY]; const [x, y] = flags.mouseLoc; - const e = core.getBlockId(x, y); + 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; const enemy = core.material.enemys[e as EnemyIds]; - const detail = getDetailedEnemy(enemy, x, y); + const detail = getDetailedEnemy(enemy, mx, my); core.plugin.bookDetailEnemy = detail; showFixed.value = true; }, 200); diff --git a/src/ui/bookDetail.vue b/src/ui/bookDetail.vue index 33cffae..a6e7b81 100644 --- a/src/ui/bookDetail.vue +++ b/src/ui/bookDetail.vue @@ -9,7 +9,10 @@ > - + { const [x, y] = flags.mouseLoc; - const e = core.getBlockId(x, y); + 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; const enemy = core.material.enemys[e as EnemyIds]; - const detail = getDetailedEnemy(enemy, x, y); + const detail = getDetailedEnemy(enemy, mx, my); core.plugin.bookDetailEnemy = detail; - core.plugin.bookDetailEnemy = getDetailedEnemy(enemy, x, y); });