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
19 changes: 7 additions & 12 deletions src/composables/useModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resolveResource, sep } from '@tauri-apps/api/path'
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
import { message } from 'ant-design-vue'
import { isNil, round } from 'es-toolkit'
import { nth } from 'es-toolkit/compat'
import { findKey, nth } from 'es-toolkit/compat'
import { ref } from 'vue'

import live2d from '../utils/live2d'
Expand Down Expand Up @@ -141,18 +141,13 @@ export function useModel() {

if (!path) return

if (catStore.model.single) {
const dirName = nth(path.split(sep()), -2)!
const dirName = nth(path.split(sep()), -2)!
const prevKey = findKey(modelStore.pressedKeys, (value) => {
return value.includes(dirName)
})

const filterKeys = Object.entries(modelStore.pressedKeys).filter(
([, value]) => {
return value.includes(dirName)
},
)

for (const [key] of filterKeys) {
handleRelease(key)
}
if (prevKey) {
handleRelease(prevKey)
}

modelStore.pressedKeys[key] = path
Expand Down
2 changes: 0 additions & 2 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"labels": {
"modelSettings": "Model Settings",
"mirrorMode": "Mirror Mode",
"singleMode": "Single Key Mode",
"mouseMirror": "Mouse Mirror",
"windowSettings": "Window Settings",
"passThrough": "Pass Through",
Expand All @@ -28,7 +27,6 @@
},
"hints": {
"mirrorMode": "When enabled, the model will be mirrored horizontally.",
"singleMode": "When enabled, only the last pressed key is displayed for each hand.",
"mouseMirror": "When enabled, the mouse will mirror the hand movement.",
"motionSound": "When enabled, the model will play corresponding sound effects when performing actions (if they exist).",
"behavior": "When enabled, motions and expressions can be configured and triggered.",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"labels": {
"modelSettings": "Configurações do Modelo",
"mirrorMode": "Modo Espelho",
"singleMode": "Mostrar Apenas Última Tecla",
"mouseMirror": "Espelho do Mouse",
"windowSettings": "Configurações da Janela",
"passThrough": "Janela Transparente",
Expand All @@ -28,7 +27,6 @@
},
"hints": {
"mirrorMode": "Quando ativado, o modelo será invertido horizontalmente.",
"singleMode": "Quando ativado, apenas a última tecla pressionada em cada mão é exibida (evita mostrar múltiplas mãos ao pressionar várias teclas ao mesmo tempo).",
"mouseMirror": "Quando ativado, o mouse espelhará o movimento da mão.",
"motionSound": "Quando ativado, o modelo reproduzirá efeitos sonoros correspondentes ao executar ações (se existirem).",
"behavior": "Quando ativado, movimentos e expressões podem ser configurados e acionados.",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"labels": {
"modelSettings": "Cài đặt Mô hình",
"mirrorMode": "Chế độ gương",
"singleMode": "Chỉ hiển thị phím cuối cùng",
"mouseMirror": "Phản chiếu chuột",
"windowSettings": "Cài đặt Cửa sổ",
"passThrough": "Click xuyên",
Expand All @@ -28,7 +27,6 @@
},
"hints": {
"mirrorMode": "Bật để lật ngang mô hình.",
"singleMode": "Khi bật, mỗi tay mèo chỉ hiển thị phím vừa nhấn cuối cùng (tránh hiện nhiều tay khi nhấn nhiều phím cùng lúc).",
"mouseMirror": "Khi bật, chuột của mô hình sẽ phản chiếu theo chuyển động chuột thực tế.",
"motionSound": "Khi bật, mô hình sẽ phát các âm thanh tương ứng khi thực hiện hành động (nếu tồn tại).",
"behavior": "Khi bật, các hành động và biểu cảm có thể được cấu hình và kích hoạt.",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"labels": {
"modelSettings": "模型设置",
"mirrorMode": "镜像模式",
"singleMode": "单键模式",
"mouseMirror": "鼠标镜像",
"windowSettings": "窗口设置",
"passThrough": "窗口穿透",
Expand All @@ -28,7 +27,6 @@
},
"hints": {
"mirrorMode": "启用后,模型将水平镜像翻转。",
"singleMode": "启用后,每只手只显示最后按下的一个按键。",
"mouseMirror": "启用后,鼠标将镜像跟随手部移动。",
"motionSound": "启用后,模型执行动作时会播放对应音效(如果存在)。",
"behavior": "启用后,可以配置和触发模型的动作与表情。",
Expand Down
2 changes: 0 additions & 2 deletions src/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"labels": {
"modelSettings": "模型設定",
"mirrorMode": "鏡像模式",
"singleMode": "單鍵模式",
"mouseMirror": "滑鼠游標鏡像",
"windowSettings": "視窗設定",
"passThrough": "視窗穿透",
Expand All @@ -28,7 +27,6 @@
},
"hints": {
"mirrorMode": "啟用後,模型將水平鏡像翻轉。",
"singleMode": "啟用後,每隻手只顯示最後按下的一個按鍵。",
"mouseMirror": "啟用後,滑鼠游標將鏡像跟隨手部移動。",
"motionSound": "啟用後,模型執行動作時會播放對應音效(如果存在)。",
"behavior": "啟用後,可以配置和觸發模型的動作與表情。",
Expand Down
7 changes: 0 additions & 7 deletions src/pages/preference/components/cat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ const catStore = useCatStore()
<Switch v-model:checked="catStore.model.mirror" />
</ProListItem>

<ProListItem
:description="$t('pages.preference.cat.hints.singleMode')"
:title="$t('pages.preference.cat.labels.singleMode')"
>
<Switch v-model:checked="catStore.model.single" />
</ProListItem>

<ProListItem
:description="$t('pages.preference.cat.hints.mouseMirror')"
:title="$t('pages.preference.cat.labels.mouseMirror')"
Expand Down
6 changes: 0 additions & 6 deletions src/stores/cat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { reactive, ref } from 'vue'
export interface CatStore {
model: {
mirror: boolean
single: boolean
mouseMirror: boolean
motionSound: boolean
behavior: boolean
Expand All @@ -28,9 +27,6 @@ export const useCatStore = defineStore('cat', () => {
/** @deprecated 请使用 `model.mirror` */
const mirrorMode = ref(false)

/** @deprecated 请使用 `model.single` */
const singleMode = ref(false)

/** @deprecated 请使用 `model.mouseMirror` */
const mouseMirror = ref(false)

Expand All @@ -51,7 +47,6 @@ export const useCatStore = defineStore('cat', () => {

const model = reactive<CatStore['model']>({
mirror: false,
single: false,
mouseMirror: false,
motionSound: true,
behavior: true,
Expand All @@ -73,7 +68,6 @@ export const useCatStore = defineStore('cat', () => {
if (migrated.value) return

model.mirror = mirrorMode.value
model.single = singleMode.value
model.mouseMirror = mouseMirror.value

window.visible = true
Expand Down