From 101bd4c3582c637a7e2747df7a4ccff80621b01f Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Mon, 30 Dec 2024 03:14:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E6=9C=9F=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD=E3=82=B0=E3=81=AE=E7=8A=B6?= =?UTF-8?q?=E6=85=8B=E7=AE=A1=E7=90=86=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97?= =?UTF-8?q?=E3=80=81openedEditor=E3=82=92=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=8A=E3=83=AB=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/App.vue | 1 + src/components/Dialog/AllDialog.vue | 29 +++++++++++++++-------------- src/store/type.ts | 4 +--- src/store/ui.ts | 2 +- src/type/preload.ts | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/components/App.vue b/src/components/App.vue index f49b89c372..cc6b8f4c80 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -160,6 +160,7 @@ onMounted(async () => { isAcceptTermsDialogOpen: import.meta.env.MODE !== "development" && store.state.acceptTerms !== "Accepted", + isInitialSettingsDialogOpen: store.state.openedEditor == undefined, }); // プロジェクトファイルが指定されていればロード diff --git a/src/components/Dialog/AllDialog.vue b/src/components/Dialog/AllDialog.vue index 2d594f3b57..57e62d764e 100644 --- a/src/components/Dialog/AllDialog.vue +++ b/src/components/Dialog/AllDialog.vue @@ -144,6 +144,21 @@ const isAcceptRetrieveTelemetryDialogOpenComputed = computed({ }), }); +// 初期設定ダイアログ +const isInitialSettingsDialogOpenComputed = computed({ + get: () => + !store.state.isAcceptTermsDialogOpen && + !store.state.isCharacterOrderDialogOpen && + !store.state.isDefaultStyleSelectDialogOpen && + !store.state.isAcceptRetrieveTelemetryDialogOpen && + store.state.isInitialSettingsDialogOpen, + set: (val) => { + void store.actions.SET_DIALOG_OPEN({ + isInitialSettingsDialogOpen: val, + }); + }, +}); + // エディタのアップデート確認ダイアログ const canOpenNotificationDialog = computed(() => { return ( @@ -172,18 +187,4 @@ const isImportSongProjectDialogOpenComputed = computed({ isImportSongProjectDialogOpen: val, }), }); - -// 初期設定ダイアログ -const isSelectedEditorType = computed(() => store.state.openedEditor); -console.log(isSelectedEditorType.value); -const isInitialSettingsDialogOpenComputed = computed({ - get: () => store.state.isInitialSettingsDialogOpen, - set: (val) => { - if (isSelectedEditorType.value) { - void store.actions.SET_DIALOG_OPEN({ - isInitialSettingsDialogOpen: val, - }); - } - }, -}); diff --git a/src/store/type.ts b/src/store/type.ts index 0a956c255c..e6f30ea84a 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -1874,9 +1874,7 @@ export type SettingStoreState = { experimentalSetting: ExperimentalSettingType; confirmedTips: ConfirmedTips; engineSettings: EngineSettings; -} & Omit & { - openedEditor: EditorType | undefined; // undefinedのときはどのエディタを開くか定まっていない - }; +} & RootMiscSettingType; // keyとvalueの型を連動するようにしたPayloadを作る type KeyValuePayload = K extends keyof R diff --git a/src/store/ui.ts b/src/store/ui.ts index 26e6931d3b..68fbb87fad 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -80,7 +80,7 @@ export const uiStoreState: UiStoreState = { isUpdateNotificationDialogOpen: false, isExportSongAudioDialogOpen: false, isImportSongProjectDialogOpen: false, - isInitialSettingsDialogOpen: true, + isInitialSettingsDialogOpen: false, isMaximized: false, isPinned: false, isFullscreen: false, diff --git a/src/type/preload.ts b/src/type/preload.ts index cd1e6cf9e4..c3a4560120 100644 --- a/src/type/preload.ts +++ b/src/type/preload.ts @@ -377,7 +377,7 @@ export type ConfirmedTips = { // ルート直下にある雑多な設定値 export const rootMiscSettingSchema = z.object({ - openedEditor: z.enum(["talk", "song"]).default("talk"), + openedEditor: z.enum(["talk", "song"]).optional(), editorFont: z.enum(["default", "os"]).default("default"), showTextLineNumber: z.boolean().default(false), showAddAudioItemButton: z.boolean().default(true),