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