From ed4b0fe7300ffb3d348a20d92d2f9f107b28514f Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Wed, 28 Dec 2022 00:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=A3=85=E5=A4=87=E6=A0=8F?= =?UTF-8?q?=E5=92=8C=E9=81=93=E5=85=B7=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/equipbox.vue | 37 ++++++++++++++++++++++++++++++------- src/ui/toolbox.vue | 14 ++++++++++++-- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/ui/equipbox.vue b/src/ui/equipbox.vue index 746cf4e..1ba3335 100644 --- a/src/ui/equipbox.vue +++ b/src/ui/equipbox.vue @@ -4,7 +4,9 @@ 返回游戏 - 道具栏 + 道具栏
@@ -69,8 +71,9 @@
@@ -183,7 +185,7 @@ import { getAddStatus, getEquips, getNowStatus } from '../plugin/ui/equipbox'; import BoxAnimate from '../components/boxAnimate.vue'; import { has, type } from '../plugin/utils'; import { cancelGlobalDrag, isMobile, useDrag } from '../plugin/use'; -import { hyper } from 'mutate-animate'; +import { hyper, sleep } from 'mutate-animate'; import { message } from 'ant-design-vue'; const equips = ref(getEquips()); @@ -392,7 +394,6 @@ function bind() { if (draged.value) { draged.value = false; loadEquip(); - console.log(toEquipType.value); } }, true @@ -422,6 +423,15 @@ function dragout(e: Event) { toEquipType.value = -1; } +async function toTool() { + const before = core.plugin.transition.value; + core.plugin.transition.value = false; + exit(); + await sleep(50); + core.plugin.toolOpened.value = true; + core.plugin.transition.value = before; +} + watch(toShow, n => { bind(); }); @@ -672,12 +682,25 @@ onUnmounted(() => { } #equipbox-main { - height: 100%; + height: 90vh; flex-direction: column-reverse; } #equip-now-div { flex-wrap: nowrap; } + + #equip-status { + flex-direction: column; + flex-basis: auto; + } + + #equip-list { + flex-basis: 50%; + } + + .divider { + margin: 1% 0 1% 0; + } } diff --git a/src/ui/toolbox.vue b/src/ui/toolbox.vue index 4a90e8c..581af2f 100644 --- a/src/ui/toolbox.vue +++ b/src/ui/toolbox.vue @@ -4,7 +4,7 @@ 返回游戏 - 装备栏
@@ -173,11 +173,12 @@ async function use(id: ShowItemIds) { if (id === 'none') return; if (core.canUseItem(id)) { // 应该暂时把动画去掉 + const before = core.plugin.transition.value; core.plugin.transition.value = false; exit(); await sleep(50); core.useItem(id); - core.plugin.transition.value = true; + core.plugin.transition.value = before; } else { message.warn({ content: '当前无法使用该道具!', @@ -186,6 +187,15 @@ async function use(id: ShowItemIds) { } } +async function toEquip() { + const before = core.plugin.transition.value; + core.plugin.transition.value = false; + exit(); + await sleep(50); + core.plugin.equipOpened.value = true; + core.plugin.transition.value = before; +} + function keyup(e: KeyboardEvent) { const c = keycode(e.keyCode); if (c === KeyCode.Escape || c === KeyCode.KeyX) {