Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ onMounted(async () => {
isAcceptTermsDialogOpen:
import.meta.env.MODE !== "development" &&
store.state.acceptTerms !== "Accepted",
isInitialSettingsDialogOpen: store.state.openedEditor == undefined,
Copy link
Author

@Hiroshiba Hiroshiba Dec 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここでopenedEditorが設定されているかどうかを見て、isInitialSettingsDialogOpenをtrueにしてます!

App.vueが表示されている直後のタイミングだと必ずstate.openedEditorundefinedになってるので、エンジンが起動した後にダイアログを開くかどうかを判定してます。
利用規約ダイアログとかも開くかどうかここで判定しているので、同じ機構にしています。

(ちなみに、これは正直既存の実装がちょっと微妙なのですが、リファクタリングができていなくてそのままにって感じです。。。)

});

// プロジェクトファイルが指定されていればロード
Expand Down
29 changes: 15 additions & 14 deletions src/components/Dialog/AllDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +150 to +154
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

利用規約ダイアログ、キャラクター並び替えダイアログなどを設定し終わってからこのダイアログが開かれるようにしてます。
UX次第だけど、順番は変えてもいいかも。

set: (val) => {
void store.actions.SET_DIALOG_OPEN({
isInitialSettingsDialogOpen: val,
});
},
});

// エディタのアップデート確認ダイアログ
const canOpenNotificationDialog = computed(() => {
return (
Expand Down Expand Up @@ -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,
});
}
},
});
</script>
4 changes: 1 addition & 3 deletions src/store/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1874,9 +1874,7 @@ export type SettingStoreState = {
experimentalSetting: ExperimentalSettingType;
confirmedTips: ConfirmedTips;
engineSettings: EngineSettings;
} & Omit<RootMiscSettingType, "openedEditor"> & {
openedEditor: EditorType | undefined; // undefinedのときはどのエディタを開くか定まっていない
};
} & RootMiscSettingType;

// keyとvalueの型を連動するようにしたPayloadを作る
type KeyValuePayload<R, K extends keyof R = keyof R> = K extends keyof R
Expand Down
2 changes: 1 addition & 1 deletion src/store/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const uiStoreState: UiStoreState = {
isUpdateNotificationDialogOpen: false,
isExportSongAudioDialogOpen: false,
isImportSongProjectDialogOpen: false,
isInitialSettingsDialogOpen: true,
isInitialSettingsDialogOpen: false,
isMaximized: false,
isPinned: false,
isFullscreen: false,
Expand Down
2 changes: 1 addition & 1 deletion src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openedEditorはconfig.json設定においてデフォルトでtalkになるようになっていたのですが、デフォルトがundefinedになるようにしてます。
これで今まで開いたことがある人には「どっちにしますか?」ダイアログが開かれず、初めて起動した人はundefinedになってダイアログが開かれるはず!

editorFont: z.enum(["default", "os"]).default("default"),
showTextLineNumber: z.boolean().default(false),
showAddAudioItemButton: z.boolean().default(true),
Expand Down
Loading