diff --git a/public/project/functions.js b/public/project/functions.js index 31fd771..eda09d7 100644 --- a/public/project/functions.js +++ b/public/project/functions.js @@ -405,16 +405,18 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = { break; case 67: // C:怪物临界 if (core.getBlockCls(mx, my)?.startsWith('enemy')) { - core.plugin.fixedDetailPanel = 'critical'; mota.plugin.fixed.showFixed.value = false; - mota.plugin.ui.fixedDetailOpened.value = true; + mota.ui.main.open('fixedDetail', void 0, { + panel: 'critical' + }); } break; case 69: // E:怪物属性 if (core.getBlockCls(mx, my)?.startsWith('enemy')) { - core.plugin.fixedDetailPanel = 'special'; mota.plugin.fixed.showFixed.value = false; - mota.plugin.ui.fixedDetailOpened.value = true; + mota.ui.main.open('fixedDetail', void 0, { + panel: 'special' + }); } break; case 77: // M:快速标记 diff --git a/public/project/items.js b/public/project/items.js index bd09b8f..ffde2a8 100644 --- a/public/project/items.js +++ b/public/project/items.js @@ -1161,21 +1161,21 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "name": "bgm查看器", "canUseItemEffect": "true", "text": "可以查看游戏内你已经听过的bgm,歌曲名格式:歌手——歌曲名。未完工。", - "useItemEffect": "mota.plugin.utils.tip('warn', '当前道具还未制作完成!');\n// mota.plugin.ui.bgmOpened.value = true;" + "useItemEffect": "mota.plugin.utils.tip('warn', '当前道具还未制作完成!');\n// mota.ui.main.open('bgm');" }, "I559": { "cls": "constants", "name": "系统设置", "canUseItemEffect": "true", "text": "内含所有系统设置项", - "useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.settingsOpened.value = true;" + "useItemEffect": "if (!core.isReplaying()) mota.ui.main.open('settings');" }, "I560": { "cls": "constants", "name": "百科全书", "canUseItemEffect": "true", "text": "一个包含游戏中所有功能详细说明的百科全书,可以查看游戏中所有的功能", - "useItemEffect": "if (!core.isReplaying()) mota.plugin.ui.descOpened.value = true;" + "useItemEffect": "if (!core.isReplaying()) mota.ui.main.open('desc');" }, "I565": { "cls": "constants", @@ -1233,7 +1233,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "cls": "constants", "name": "成就", "canUseItemEffect": "true", - "useItemEffect": "mota.plugin.ui.achievementOpened.value = true;", + "useItemEffect": "mota.ui.main.open('achievement');", "text": "可以查看成就" } } \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 3f5213a..d700170 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,20 +1,13 @@ diff --git a/src/ui/skillTree.vue b/src/ui/skillTree.vue index 70f01b3..60a5df0 100644 --- a/src/ui/skillTree.vue +++ b/src/ui/skillTree.vue @@ -82,6 +82,10 @@ import { isMobile } from '../plugin/use'; import { sleep } from 'mutate-animate'; import { KeyCode } from '../plugin/keyCodes'; +const props = defineProps<{ + num: number; +}>(); + let canvas: HTMLCanvasElement; let ctx: CanvasRenderingContext2D; @@ -173,7 +177,7 @@ const level = computed(() => { }); function exit() { - mota.plugin.ui.skillTreeOpened.value = false; + mota.ui.main.close(props.num); } function resize() { diff --git a/src/ui/start.vue b/src/ui/start.vue index 38532c9..a323263 100644 --- a/src/ui/start.vue +++ b/src/ui/start.vue @@ -67,7 +67,6 @@ import { sleep } from 'mutate-animate'; import { Matrix4 } from '../plugin/webgl/matrix'; import { doByInterval, keycode } from '../plugin/utils'; import { KeyCode } from '../plugin/keyCodes'; -import { achievementOpened } from '../plugin/uiController'; import { triggerFullscreen } from '../plugin/utils'; import { loading } from '../core/loader/load'; import { isMobile } from '../plugin/use'; @@ -149,7 +148,7 @@ async function clickStartButton(id: string) { } if (id === 'replay') core.chooseReplayFile(); if (id === 'achievement') { - achievementOpened.value = true; + mota.ui.main.open('achievement'); } } diff --git a/src/ui/toolbox.vue b/src/ui/toolbox.vue index 76f0543..bb36867 100644 --- a/src/ui/toolbox.vue +++ b/src/ui/toolbox.vue @@ -118,6 +118,10 @@ import { hyper, sleep } from 'mutate-animate'; import { message } from 'ant-design-vue'; import { KeyCode } from '../plugin/keyCodes'; +const props = defineProps<{ + num: number; +}>(); + type ItemMode = 'tools' | 'constants'; type ShowItemIds = ItemIdOf<'constants' | 'tools'> | 'none'; @@ -165,7 +169,7 @@ async function select(id: ShowItemIds, nouse: boolean = false) { } function exit() { - mota.plugin.ui.toolOpened.value = false; + mota.ui.main.close(props.num); } async function use(id: ShowItemIds) { @@ -187,12 +191,9 @@ async function use(id: ShowItemIds) { } async function toEquip() { - const before = mota.plugin.ui.transition.value; - mota.plugin.ui.transition.value = false; + mota.ui.main.holdOn(); exit(); - await sleep(50); - mota.plugin.ui.equipOpened.value = true; - mota.plugin.ui.transition.value = before; + mota.ui.main.open('equipbox'); } function keyup(e: KeyboardEvent) {