@@ -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) {