From 90985fb287bbccaa339a374de124af7fce08b7f2 Mon Sep 17 00:00:00 2001 From: Takusea Date: Sun, 29 Dec 2024 15:47:54 +0900 Subject: [PATCH 01/30] =?UTF-8?q?BaseSlider=E3=81=AE=E9=AB=98=E3=81=95?= =?UTF-8?q?=E3=82=92=E5=B0=91=E3=81=97=E5=B0=8F=E3=81=95=E3=82=81=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Base/BaseSlider.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Base/BaseSlider.vue b/src/components/Base/BaseSlider.vue index 1c84e7fff1..2cb659d572 100644 --- a/src/components/Base/BaseSlider.vue +++ b/src/components/Base/BaseSlider.vue @@ -49,7 +49,7 @@ const model = defineModel({ required: true }); position: relative; display: flex; align-items: center; - height: vars.$size-control; + height: vars.$size-indicator; cursor: grab; &:active { From da95662c4fd652d0c4e02b520246de1a9d236f4e Mon Sep 17 00:00:00 2001 From: Takusea Date: Sun, 29 Dec 2024 15:59:39 +0900 Subject: [PATCH 02/30] =?UTF-8?q?BaseSlider=E3=82=92=E3=83=9B=E3=82=A4?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E6=93=8D=E4=BD=9C=E5=8F=AF=E8=83=BD=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Base/BaseSlider.vue | 44 +++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/components/Base/BaseSlider.vue b/src/components/Base/BaseSlider.vue index 2cb659d572..51d698aef4 100644 --- a/src/components/Base/BaseSlider.vue +++ b/src/components/Base/BaseSlider.vue @@ -5,7 +5,7 @@ :max :step :disabled - :modelValue="[model]" + :modelValue="[modelValue]" @update:modelValue=" (value) => { if (value == undefined) { @@ -14,6 +14,7 @@ $emit('update:modelValue', value[0]); } " + @wheel="onWheel" > @@ -24,20 +25,43 @@ From 22a725f776ac8ec827984e27b41bfa9fbfffce19 Mon Sep 17 00:00:00 2001 From: Takusea Date: Sun, 29 Dec 2024 16:10:39 +0900 Subject: [PATCH 05/30] =?UTF-8?q?=E3=83=97=E3=83=AA=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E7=AE=A1=E7=90=86=E3=83=80=E3=82=A4=E3=82=A2=E3=83=AD?= =?UTF-8?q?=E3=82=B0=E3=81=AB=E7=B7=A8=E9=9B=86=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialog/PresetManageDialog.vue | 234 +++++++++++++------ 1 file changed, 167 insertions(+), 67 deletions(-) diff --git a/src/components/Dialog/PresetManageDialog.vue b/src/components/Dialog/PresetManageDialog.vue index 0c5da3ee16..af02d7710c 100644 --- a/src/components/Dialog/PresetManageDialog.vue +++ b/src/components/Dialog/PresetManageDialog.vue @@ -56,62 +56,72 @@
-
+

{{ selectedPreset.name }}

+
+ + +
-
-

モーフィング

- - {{ morphingTargetCharacterInfo.metas.speakerName }} + + {{ + morphingTargetCharacterInfo + ? morphingTargetCharacterInfo.metas.speakerName + : "未設定" + }} -
- 割合 - - {{ selectedPreset.morphingInfo.rate.toFixed(2) }} - -
- - -
+ +
+
@@ -149,17 +178,24 @@ diff --git a/src/components/Talk/ParameterSlider.vue b/src/components/Talk/ParameterSlider.vue index 50ffcabb8d..3462176adc 100644 --- a/src/components/Talk/ParameterSlider.vue +++ b/src/components/Talk/ParameterSlider.vue @@ -6,7 +6,7 @@
From 8f7a24d8a8738a0d9d70d291476aff3217602906 Mon Sep 17 00:00:00 2001 From: Takusea Date: Thu, 2 Jan 2025 22:10:06 +0900 Subject: [PATCH 09/30] =?UTF-8?q?=E3=83=97=E3=83=AA=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E3=81=AE=E7=B7=A8=E9=9B=86=E5=86=85=E5=AE=B9=E3=82=92?= =?UTF-8?q?=E5=8D=B3=E6=99=82=E5=8F=8D=E6=98=A0=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=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/Dialog/PresetManageDialog.vue | 246 ++++++++++--------- 1 file changed, 136 insertions(+), 110 deletions(-) diff --git a/src/components/Dialog/PresetManageDialog.vue b/src/components/Dialog/PresetManageDialog.vue index af02d7710c..90078aad08 100644 --- a/src/components/Dialog/PresetManageDialog.vue +++ b/src/components/Dialog/PresetManageDialog.vue @@ -56,14 +56,16 @@
-
+

{{ selectedPreset.name }}

-

モーフィング

-
- +

モーフィング

+
+ + + {{ + morphingTargetCharacterInfo + ? morphingTargetCharacterInfo.metas.speakerName + : "未設定" + }} + + + ({{ morphingTargetStyleInfo?.styleName }}) + +
+ - - {{ - morphingTargetCharacterInfo - ? morphingTargetCharacterInfo.metas.speakerName - : "未設定" - }} - - - ({{ morphingTargetStyleInfo?.styleName }}) - -
- +
@@ -178,7 +172,7 @@ diff --git a/src/components/Dialog/PresetManageDialog.vue b/src/components/Dialog/PresetManageDialog.vue index fa9258fc01..87b8c8805f 100644 --- a/src/components/Dialog/PresetManageDialog.vue +++ b/src/components/Dialog/PresetManageDialog.vue @@ -180,6 +180,9 @@ import { PresetSliderKey, } from "@/type/preload"; import { SLIDER_PARAMETERS } from "@/store/utility"; +import { cloneWithUnwrapProxy } from "@/helpers/cloneWithUnwrapProxy"; +import { debounce } from "@/helpers/timer"; +import { UnreachableError } from "@/type/utility"; const props = defineProps<{ openDialog: boolean; @@ -241,27 +244,25 @@ watch(selectedPresetKey, (key) => { return; } - const preset = presetItems.value[key]; - selectedPreset.value = { - ...preset, - morphingInfo: preset.morphingInfo ? { ...preset.morphingInfo } : undefined, - }; + selectedPreset.value = cloneWithUnwrapProxy(presetItems.value[key]); }); +const debouncedUpdatePreset = debounce(store.actions.UPDATE_PRESET, 300); watch( - () => - Object.entries({ - ...selectedPreset.value, - ...selectedPreset.value?.morphingInfo, - }), - async () => { - if (!selectedPreset.value || !selectedPreset.value.name) return; - - await store.actions.UPDATE_PRESET({ - presetData: selectedPreset.value, + () => selectedPreset.value, + (value) => { + if (value == undefined) { + throw new UnreachableError(value); + } + if (value.name == "") return; + + // NOTE: debounce中にkeyが変わった場合に対応するため、watchのコールバックに直接debounceを使っていない + void debouncedUpdatePreset({ + presetData: value, presetKey: selectedPresetKey.value, }); }, + { deep: true }, ); const changePresetName = (event: Event) => { diff --git a/src/helpers/timer.ts b/src/helpers/timer.ts new file mode 100644 index 0000000000..969dc4a21a --- /dev/null +++ b/src/helpers/timer.ts @@ -0,0 +1,15 @@ +/** + * debounce関数を返す。 + * 最後に呼び出されてから指定した時間が経過した後にコールバックが実行される。 + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function debounce unknown>( + callback: T, + delay: number, +): (...args: Parameters) => void { + let timeoutId: ReturnType; + return (...args) => { + clearTimeout(timeoutId); + timeoutId = setTimeout(() => callback(...args), delay); + }; +} From a55a8b3397d538cf8e529b1ba890141ab5f8318a Mon Sep 17 00:00:00 2001 From: Takusea <53995265+takusea@users.noreply.github.com> Date: Thu, 16 Jan 2025 23:57:03 +0900 Subject: [PATCH 18/30] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AB=E6=B3=A8=E9=87=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Hiroshiba --- src/components/Dialog/PresetManageDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Dialog/PresetManageDialog.vue b/src/components/Dialog/PresetManageDialog.vue index 87b8c8805f..e0108d4cf0 100644 --- a/src/components/Dialog/PresetManageDialog.vue +++ b/src/components/Dialog/PresetManageDialog.vue @@ -85,7 +85,7 @@ :label="parameterLabels[sliderKey as ParameterType]" /> - +