From 6b963237f586fc712d1608b921da0e0ba7fb8720 Mon Sep 17 00:00:00 2001 From: Yuto Ashida Date: Fri, 26 Nov 2021 17:02:17 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E3=81=AA=E3=81=84=E3=82=AD=E3=83=A3=E3=83=A9=E3=81=AE?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=81=AEUI=E3=83=BB=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#510)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor "is unset default style id" make it possible to get by uuid of each speaker * fix miss(logical operation) * only show added new character in default style select dialog at startup * fix portrait in default style select dialog * remove separator and arrow right icon from character info that has not style * fix menu bar * add fix me comment * add comment and refactor * add comment close dialog * use throw Error --- src/background.ts | 5 +- src/components/AudioCell.vue | 108 ++++++++-------- src/components/DefaultStyleSelectDialog.vue | 129 ++++++++++++++------ src/components/MenuBar.vue | 2 +- src/electron/preload.ts | 4 +- src/store/index.ts | 4 +- src/store/type.ts | 4 +- src/type/ipc.d.ts | 4 +- src/type/preload.d.ts | 2 +- src/views/Home.vue | 10 +- 10 files changed, 169 insertions(+), 103 deletions(-) diff --git a/src/background.ts b/src/background.ts index ff6542908e..45dbc046b3 100644 --- a/src/background.ts +++ b/src/background.ts @@ -682,8 +682,9 @@ ipcMainHandle("CHANGE_PIN_WINDOW", () => { } }); -ipcMainHandle("IS_UNSET_DEFAULT_STYLE_IDS", () => { - return store.get("defaultStyleIds").length === 0; +ipcMainHandle("IS_UNSET_DEFAULT_STYLE_ID", (_, speakerUuid) => { + const defaultStyleIds = store.get("defaultStyleIds"); + return !defaultStyleIds.find((style) => style.speakerUuid === speakerUuid); }); ipcMainHandle("GET_DEFAULT_STYLE_IDS", () => { diff --git a/src/components/AudioCell.vue b/src/components/AudioCell.vue index c2f6078c72..9df929b120 100644 --- a/src/components/AudioCell.vue +++ b/src/components/AudioCell.vue @@ -53,57 +53,67 @@
{{ characterInfo.metas.speakerName }}
- - -
- - - + diff --git a/src/components/DefaultStyleSelectDialog.vue b/src/components/DefaultStyleSelectDialog.vue index 85c5149a1b..e8b297f145 100644 --- a/src/components/DefaultStyleSelectDialog.vue +++ b/src/components/DefaultStyleSelectDialog.vue @@ -11,15 +11,26 @@
- 「{{ - characterInfos[pageIndex].metas.speakerName - }}」のデフォルトのスタイル(喋り方)を選んでください + 「{{ showCharacterInfos[pageIndex].metas.speakerName }}」の{{ + showCharacterInfos[pageIndex].metas.styles.length > 1 + ? "デフォルトのスタイル(喋り方)を選んでください" + : "サンプル音声を視聴できます" + }} + 設定 / デフォルトスタイル設定 / デフォルトスタイル・試聴 + - ※後からでも変更できます
@@ -38,11 +49,11 @@ />
- {{ pageIndex + 1 }} / {{ characterInfos.length }} + {{ pageIndex + 1 }} / {{ showCharacterInfos.length }}
- + @@ -163,7 +175,7 @@