完善定点查看

This commit is contained in:
AncTe committed 2023-01-06 22:42:46 +08:00
1 parent 2cfbe4984f
commit 77d051dd27
8 files changed
+38 -16

No files matched your search

+4
View File
@@ -310,6 +310,10 @@
"本塔的怪物手册功能很多,下面一一介绍。",
"<br>",
"<br>",
"首先,你可以按X打开怪物手册。将鼠标移动到一个怪物上,按下<span style=\"color: gold\">",
"K键</span>,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"<br>",
"<br>",
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",
"<br>",
"<br>",
+1 -1
View File
@@ -37,7 +37,7 @@
"useFixed": {
"text": "移动鼠标显示怪物信息",
"desc": [
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。",
"开启后,当鼠标移动到怪物上时,会以盒子的形式展示该点的怪物信息。手机端此功能无效。",
"<br>",
"<br>",
"注:当鼠标移动到怪物上时,经过200毫秒才会显示信息,防止误操作。"
+6 -2
View File
@@ -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,
+10 -1
View File
@@ -35,12 +35,21 @@
<script lang="ts" setup>
import { isMobile } from '../plugin/use';
import { getSpecialHint } from '../plugin/ui/book';
import { has } from '../plugin/utils';
const props = defineProps<{
fromBook?: boolean;
}>();
const [x, y] = props.fromBook ? [void 0, void 0] : flags.mouseLoc;
const mx = has(x) ? Math.round(x + core.bigmap.offsetX / 32) : void 0;
const my = has(y) ? Math.round(y + core.bigmap.offsetY / 32) : void 0;
const enemy = core.plugin.bookDetailEnemy;
const info = getSpecialHint(enemy);
const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8);
const criticals = core.nextCriticals(enemy, isMobile ? 4 : 8, mx, my);
const format = core.formatBigNumber;
</script>
+4 -2
View File
@@ -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);
+4 -1
View File
@@ -9,7 +9,10 @@
></a-divider>
</div>
<Transition name="detail">
<EnemySpecial v-if="panel === 'special'"></EnemySpecial>
<EnemySpecial
:from-book="fromBook"
v-if="panel === 'special'"
></EnemySpecial>
<EnemyCritical
:from-book="fromBook"
v-else-if="panel === 'critical'"
+4 -3
View File
@@ -17,12 +17,13 @@ function close() {
onMounted(() => {
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);
});
</script>