refactor: 定点查看怪物详细信息

This commit is contained in:
AncTe committed 2023-11-19 20:47:21 +08:00
1 parent eaad1f0a5a
commit 1e58dbe411
4 files changed
+31 -17

No files matched your search

+9 -2
View File
@@ -1,6 +1,6 @@
import { debounce } from 'lodash-es';
import { gameListener } from '../game';
import { fixedUi } from './ui';
import { gameListener, hook } from '../game';
import { fixedUi, mainUi } from './ui';
import { ref } from 'vue';
import { sleep } from 'mutate-animate';
@@ -53,3 +53,10 @@ gameListener.on('mouseMove', e => {
showFixed(hovered);
}
});
hook.once('mounted', () => {
mainUi.on('start', () => {
showFixed.cancel();
closeFixed();
});
});
+7 -2
View File
@@ -3,6 +3,7 @@ import { Hotkey } from '../custom/hotkey';
import { generateBinary, keycode } from '@/plugin/utils';
import { hovered } from './fixed';
import { hasMarkedEnemy, markEnemy, unmarkEnemy } from '@/plugin/mark';
import { mainUi } from './ui';
export const mainScope = Symbol.for('@key_main');
export const gameKey = new Hotkey('gameKey', '游戏按键');
@@ -405,8 +406,12 @@ gameKey
else markEnemy(id);
}
})
.realize('special', () => {})
.realize('critical', () => {})
.realize('special', () => {
mainUi.open('fixedDetail', { panel: 'special' });
})
.realize('critical', () => {
mainUi.open('fixedDetail', { panel: 'critical' });
})
.realize('restart', () => {
core.confirmRestart();
})