diff --git a/packages/stage-ui/src/components/Live2D/Model.vue b/packages/stage-ui/src/components/Live2D/Model.vue index 12d084a0d..a61fe98b9 100644 --- a/packages/stage-ui/src/components/Live2D/Model.vue +++ b/packages/stage-ui/src/components/Live2D/Model.vue @@ -184,7 +184,7 @@ async function initLive2DPixiStage() { loadingLive2dModel.value = false } -async function setMotion(motionName: string, index: number) { +async function setMotion(motionName: string, index?: number) { await model.value!.motion(motionName, index, MotionPriority.FORCE) } diff --git a/packages/stage-ui/src/components/Widgets/Stage.vue b/packages/stage-ui/src/components/Widgets/Stage.vue index eb1eab118..f6ba318e5 100644 --- a/packages/stage-ui/src/components/Widgets/Stage.vue +++ b/packages/stage-ui/src/components/Widgets/Stage.vue @@ -128,7 +128,7 @@ const emotionsQueue = useQueue({ await vrmViewerRef.value!.setExpression(value) } else if (stageView.value === '2d') { - live2dCurrentMotion.value = EMOTION_EmotionMotionName_value[ctx.data] + live2dCurrentMotion.value = { group: EMOTION_EmotionMotionName_value[ctx.data] } } }, ], @@ -173,7 +173,7 @@ onBeforeMessageComposed(async () => { }) onBeforeSend(async () => { - live2dCurrentMotion.value = EmotionThinkMotionName + live2dCurrentMotion.value = { group: EmotionThinkMotionName } }) onTokenLiteral(async (literal) => { @@ -212,13 +212,13 @@ onMounted(() => { const extendedWindow = window as Window & typeof globalThis & { electron?: ElectronAPI } extendedWindow.electron?.ipcRenderer.on('before-hide', () => { - live2dCurrentMotion.value = EmotionAngryMotionName + live2dCurrentMotion.value = { group: EmotionAngryMotionName } }) extendedWindow.electron?.ipcRenderer.on('after-show', () => { - live2dCurrentMotion.value = EmotionHappyMotionName + live2dCurrentMotion.value = { group: EmotionHappyMotionName } }) extendedWindow.electron?.ipcRenderer.on('before-quit', () => { - live2dCurrentMotion.value = EmotionThinkMotionName + live2dCurrentMotion.value = { group: EmotionThinkMotionName } }) }) diff --git a/packages/stage-ui/src/stores/settings.ts b/packages/stage-ui/src/stores/settings.ts index 8e4be588a..fbcb6a00e 100644 --- a/packages/stage-ui/src/stores/settings.ts +++ b/packages/stage-ui/src/stores/settings.ts @@ -29,7 +29,7 @@ export const useSettings = defineStore('settings', () => { const live2dLoadSource = ref<'file' | 'url'>('url') const loadingLive2dModel = ref(false) // if set to true, the model will be loaded const live2dPosition = useLocalStorage('settings/live2d/position', { x: 0, y: 0 }) // position is relative to the center of the screen - const live2dCurrentMotion = ref<{ group: string, index: number }>({ group: 'Idle', index: 0 }) + const live2dCurrentMotion = ref<{ group: string, index?: number }>({ group: 'Idle', index: 0 }) const availableLive2dMotions = ref<{ motionName: string, motionIndex: number, fileName: string }[]>([]) const live2dMotionMap = useLocalStorage>('settings/live2d/motion-map', {}) diff --git a/packages/ui-transitions/src/components/BubbleWaveOutTransition.vue b/packages/ui-transitions/src/components/BubbleWaveOutTransition.vue index 0eb89d17b..f32077b64 100644 --- a/packages/ui-transitions/src/components/BubbleWaveOutTransition.vue +++ b/packages/ui-transitions/src/components/BubbleWaveOutTransition.vue @@ -10,11 +10,11 @@ const props = defineProps<{ } }>() -const colors = computed(() => props.stageTransition.colors || ['#eee', '#ebcb8b', '#c56370', '#3f3b52']) +const colors = computed(() => props.stageTransition?.colors || ['#eee', '#ebcb8b', '#c56370', '#3f3b52']) onMounted(() => { - document.documentElement.style.setProperty('--circle-expansion-delay', `${props.stageTransition.delay || 0}s`) - document.documentElement.style.setProperty('--circle-expansion-duration', `${props.stageTransition.duration || 0.4}s`) + document.documentElement.style.setProperty('--circle-expansion-delay', `${props.stageTransition?.delay || 0}s`) + document.documentElement.style.setProperty('--circle-expansion-duration', `${props.stageTransition?.duration || 0.4}s`) colors.value.forEach((color, index) => { document.documentElement.style.setProperty(`--circle-expansion-color-${index + 1}`, color) }) @@ -22,7 +22,7 @@ onMounted(() => { diff --git a/packages/ui-transitions/src/components/FantasyFallTransition.vue b/packages/ui-transitions/src/components/FantasyFallTransition.vue index 27e933857..63b99d5da 100644 --- a/packages/ui-transitions/src/components/FantasyFallTransition.vue +++ b/packages/ui-transitions/src/components/FantasyFallTransition.vue @@ -16,21 +16,21 @@ const props = defineProps <{ } }>() -const direction = computed(() => props.stageTransition.direction || 'up') +const direction = computed(() => props.stageTransition?.direction || 'up') const directionClass = computed(() => `fantasy-fall-${direction.value}`) onMounted(() => { - document.documentElement.style.setProperty('--fantasy-fall-color', props.stageTransition.primaryColor || '#eee') - document.documentElement.style.setProperty('--fantasy-fall-duration', `${props.stageTransition.duration || 0.6}s`) - document.documentElement.style.setProperty('--fantasy-fall-delay', `${props.stageTransition.delay || 0}s`) - document.documentElement.style.setProperty('--fantasy-fall-radius-sm', `${props.stageTransition.borderRadius?.sm || '14rem'}`) - document.documentElement.style.setProperty('--fantasy-fall-radius-md', `${props.stageTransition.borderRadius?.md || '14rem'}`) - document.documentElement.style.setProperty('--fantasy-fall-radius-lg', `${props.stageTransition.borderRadius?.lg || '50%'}`) + document.documentElement.style.setProperty('--fantasy-fall-color', props.stageTransition?.primaryColor || '#eee') + document.documentElement.style.setProperty('--fantasy-fall-duration', `${props.stageTransition?.duration || 0.6}s`) + document.documentElement.style.setProperty('--fantasy-fall-delay', `${props.stageTransition?.delay || 0}s`) + document.documentElement.style.setProperty('--fantasy-fall-radius-sm', `${props.stageTransition?.borderRadius?.sm || '14rem'}`) + document.documentElement.style.setProperty('--fantasy-fall-radius-md', `${props.stageTransition?.borderRadius?.md || '14rem'}`) + document.documentElement.style.setProperty('--fantasy-fall-radius-lg', `${props.stageTransition?.borderRadius?.lg || '50%'}`) })