mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 12:49:25 +08:00
fix: 道具栏和装备栏转换使按键失效
This commit is contained in:
parent
bd0205ff46
commit
c423750885
@ -468,10 +468,22 @@ gameKey
|
||||
}
|
||||
})
|
||||
.realize('special', () => {
|
||||
mainUi.open('fixedDetail', { panel: 'special' });
|
||||
if (hovered) {
|
||||
const { x, y } = hovered;
|
||||
const enemy = core.status.thisMap.enemy.list.find(v => {
|
||||
return v.x === x && v.y === y;
|
||||
});
|
||||
if (enemy) mainUi.open('fixedDetail', { panel: 'special' });
|
||||
}
|
||||
})
|
||||
.realize('critical', () => {
|
||||
mainUi.open('fixedDetail', { panel: 'critical' });
|
||||
if (hovered) {
|
||||
const { x, y } = hovered;
|
||||
const enemy = core.status.thisMap.enemy.list.find(v => {
|
||||
return v.x === x && v.y === y;
|
||||
});
|
||||
if (enemy) mainUi.open('fixedDetail', { panel: 'critical' });
|
||||
}
|
||||
})
|
||||
.realize('restart', () => {
|
||||
core.confirmRestart();
|
||||
|
@ -438,7 +438,9 @@ function dragout(e: Event) {
|
||||
function toTool() {
|
||||
mota.ui.main.holdOn();
|
||||
exit();
|
||||
mota.ui.main.open('toolbox');
|
||||
nextTick(() => {
|
||||
mota.ui.main.open('toolbox');
|
||||
});
|
||||
}
|
||||
|
||||
gameKey.use(props.ui.symbol);
|
||||
|
@ -36,6 +36,8 @@ if (hovered) {
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
|
||||
function close() {
|
||||
|
@ -108,7 +108,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { LeftOutlined, RightOutlined } from '@ant-design/icons-vue';
|
||||
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import Scroll from '../components/scroll.vue';
|
||||
import BoxAnimate from '../components/boxAnimate.vue';
|
||||
import { getClsName, getItems } from '../plugin/ui/toolbox';
|
||||
@ -180,10 +180,12 @@ function use(id: ShowItemIds) {
|
||||
if (core.canUseItem(id)) {
|
||||
const hold = mota.ui.main.holdOn();
|
||||
exit();
|
||||
core.useItem(id, false, () => {
|
||||
if (mota.ui.main.stack.length === 0) {
|
||||
hold.end();
|
||||
}
|
||||
nextTick(() => {
|
||||
core.useItem(id, false, () => {
|
||||
if (mota.ui.main.stack.length === 0) {
|
||||
hold.end();
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
message.warn({
|
||||
@ -196,7 +198,9 @@ function use(id: ShowItemIds) {
|
||||
async function toEquip() {
|
||||
mota.ui.main.holdOn();
|
||||
exit();
|
||||
mota.ui.main.open('equipbox');
|
||||
nextTick(() => {
|
||||
mota.ui.main.open('equipbox');
|
||||
});
|
||||
}
|
||||
|
||||
gameKey.use(props.ui.symbol);
|
||||
|
Loading…
Reference in New Issue
Block a user