From d178908649c4c877012dccbdc65bf410dee66c29 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Mon, 13 Nov 2023 13:02:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=8C=E6=88=90=E6=88=90?= =?UTF-8?q?=E5=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 - src/core/main/setting.ts | 3 +-- src/plugin/ui/achievement.ts | 6 +----- src/ui/completeAchievement.vue | 6 ++++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index 872d882..3ffbbd7 100644 --- a/index.html +++ b/index.html @@ -159,7 +159,6 @@
-
diff --git a/src/core/main/setting.ts b/src/core/main/setting.ts index 56f4d79..f9f2a74 100644 --- a/src/core/main/setting.ts +++ b/src/core/main/setting.ts @@ -276,7 +276,6 @@ mainSetting.on('valueChange', (key, n, o) => { }); const root = document.getElementById('root') as HTMLDivElement; -const root2 = document.getElementById('root2') as HTMLDivElement; function handleScreenSetting( key: string, @@ -318,7 +317,7 @@ function handleScreenSetting( } else if (key === 'fontSize') { // 字体大小 core.setLocalStorage('fontSize', n); - root.style.fontSize = root2.style.fontSize = `${n}px`; + root.style.fontSize = `${n}px`; } else if (key === 'smoothView') { core.setLocalStorage('smoothView', n); } else if (key === 'criticalGem') { diff --git a/src/plugin/ui/achievement.ts b/src/plugin/ui/achievement.ts index 4a60369..c55981a 100644 --- a/src/plugin/ui/achievement.ts +++ b/src/plugin/ui/achievement.ts @@ -21,9 +21,6 @@ export default function init() { return { completeAchievement, hasCompletedAchievement, addMountSign }; } -export const showComplete = ref(false); -export const completeAchi = ref('explore,1'); - export const totalPoint = Object.values(list) .map((v: Achievement[]) => v.reduce((prev, curr) => { @@ -54,8 +51,7 @@ export function completeAchievement(type: AchievementType, index: number) { if (type === 'explore' && !Object.values(achiDict).includes(index)) { checkCompletionAchievement(); } - completeAchi.value = `${type},${index}`; - showComplete.value = true; + mota.ui.fixed.open('completeAchi', { complete: `${type},${index}` }); } /** diff --git a/src/ui/completeAchievement.vue b/src/ui/completeAchievement.vue index 9251dcd..1d61ffe 100644 --- a/src/ui/completeAchievement.vue +++ b/src/ui/completeAchievement.vue @@ -25,13 +25,15 @@ import list from '../data/achievement.json'; import { AchievementType, getNowPoint, - showComplete, totalPoint } from '../plugin/ui/achievement'; +import { GameUi } from '@/core/main/custom/ui'; const height = window.innerHeight; const props = defineProps<{ + num: number; + ui: GameUi; complete: string; }>(); @@ -60,7 +62,7 @@ onMounted(async () => { now.value = Math.floor(nowPoint + point * ratio); }); await sleep(4600); - showComplete.value = false; + mota.ui.fixed.close(props.num); });