refactor(stage-ui,i18n): default to use force blink (our version)
This commit is contained in:
@@ -108,7 +108,7 @@ live2d:
|
||||
title: FPS
|
||||
description: Limit rendering frame rate
|
||||
options:
|
||||
unlimited: No Limit
|
||||
unlimited: ∞
|
||||
microphone: Microphone
|
||||
models: Model
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS
|
||||
description: Limitar velocidad de fotogramas
|
||||
options:
|
||||
unlimited: Sin límite
|
||||
unlimited: ∞
|
||||
microphone: Micrófono
|
||||
models: Modelo
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS
|
||||
description: Limiter la fréquence d'image du rendu
|
||||
options:
|
||||
unlimited: Aucune Limite
|
||||
unlimited: ∞
|
||||
microphone: Microphone
|
||||
models: Modèle
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS
|
||||
description: レンダリングフレームレートを制限
|
||||
options:
|
||||
unlimited: 制限なし
|
||||
unlimited: ∞
|
||||
microphone: マイク
|
||||
models: モデル
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS (초당 프레임)
|
||||
description: 렌더링 주사율 제한
|
||||
options:
|
||||
unlimited: 무제한
|
||||
unlimited: ∞
|
||||
microphone: 마이크
|
||||
models: 모델
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: ФПС
|
||||
description: Ограничить скорость рендеринга кадров
|
||||
options:
|
||||
unlimited: Без ограничений
|
||||
unlimited: ∞
|
||||
microphone: Микрофон
|
||||
models: Модель
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS
|
||||
description: Giới hạn tốc độ khung hình hiển thị
|
||||
options:
|
||||
unlimited: Không giới hạn
|
||||
unlimited: ∞
|
||||
microphone: Micro
|
||||
models: Mô hình
|
||||
pages:
|
||||
|
||||
@@ -106,7 +106,7 @@ live2d:
|
||||
title: FPS
|
||||
description: 限制渲染幀率
|
||||
options:
|
||||
unlimited: 無限制
|
||||
unlimited: ∞
|
||||
microphone: 麥克風
|
||||
models: 模型
|
||||
pages:
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ref, toValue, watch } from 'vue'
|
||||
export interface Versioned<T> { version?: string, data?: T }
|
||||
export interface UseVersionedStorageOptions<T> {
|
||||
defaultVersion?: string
|
||||
satisfiesVersionBy?: (version: string) => boolean
|
||||
satisfiesVersionBy?: (beforeVersion: string, afterVersion: string) => boolean
|
||||
onVersionMismatch?: (value: Versioned<T>) => OnVersionMismatchActions<T>
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export function useVersionedLocalStorage<T>(
|
||||
watch(rawValue, (value) => {
|
||||
try {
|
||||
if ('version' in rawValue.value && rawValue.value.version != null) {
|
||||
if (options?.satisfiesVersionBy != null && !options.satisfiesVersionBy(rawValue.value.version)) {
|
||||
if (options?.satisfiesVersionBy != null && !options.satisfiesVersionBy(rawValue.value.version, defaultVersion)) {
|
||||
if (options.onVersionMismatch != null) {
|
||||
const action = options.onVersionMismatch(rawValue.value)
|
||||
if (action.action === 'reset') {
|
||||
@@ -36,7 +36,7 @@ export function useVersionedLocalStorage<T>(
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.warn(`version ${rawValue.value.version} doesn't satisfy the version ${options.defaultVersion} for key ${key}, will reset the value to default value ${toValue(initialValue)}`)
|
||||
console.warn(`version ${rawValue.value.version} doesn't satisfy the version ${defaultVersion} for key ${key}, will reset the value to default value ${toValue(initialValue)}`)
|
||||
rawValue.value = { version: defaultVersion, data: toValue(initialValue) }
|
||||
data.value = toValue(initialValue)
|
||||
}
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
import { useLocalStorageManualReset } from '@proj-airi/stage-shared/composables'
|
||||
import { useLocalStorageManualReset, useVersionedLocalStorageManualReset } from '@proj-airi/stage-shared/composables'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useSettingsLive2d = defineStore('settings-live2d', () => {
|
||||
const live2dDisableFocus = useLocalStorageManualReset<boolean>('settings/live2d/disable-focus', false)
|
||||
const live2dIdleAnimationEnabled = useLocalStorageManualReset<boolean>('settings/live2d/idle-animation-enabled', true)
|
||||
const live2dAutoBlinkEnabled = useLocalStorageManualReset<boolean>('settings/live2d/auto-blink-enabled', true)
|
||||
const live2dForceAutoBlinkEnabled = useLocalStorageManualReset<boolean>('settings/live2d/force-auto-blink-enabled', false)
|
||||
const live2dAutoBlinkEnabled = useVersionedLocalStorageManualReset<boolean>('settings/live2d/auto-blink-enabled', false, {
|
||||
defaultVersion: '2.0.0',
|
||||
satisfiesVersionBy(beforeVersion, afterVersion) {
|
||||
if (beforeVersion === afterVersion) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
})
|
||||
const live2dForceAutoBlinkEnabled = useVersionedLocalStorageManualReset<boolean>('settings/live2d/force-auto-blink-enabled', true, {
|
||||
defaultVersion: '2.0.0',
|
||||
satisfiesVersionBy(beforeVersion, afterVersion) {
|
||||
if (beforeVersion === afterVersion) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
})
|
||||
const live2dShadowEnabled = useLocalStorageManualReset<boolean>('settings/live2d/shadow-enabled', true)
|
||||
const live2dMaxFps = useLocalStorageManualReset<number>('settings/live2d/max-fps', 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user