Skip to content

Commit 204797b

Browse files
authored
feat: 移除「猫咪设置 > 模型设置 > 单键模式」配置项 (#909)
1 parent a703d0a commit 204797b

8 files changed

Lines changed: 7 additions & 35 deletions

File tree

src/composables/useModel.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { resolveResource, sep } from '@tauri-apps/api/path'
55
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
66
import { message } from 'ant-design-vue'
77
import { isNil, round } from 'es-toolkit'
8-
import { nth } from 'es-toolkit/compat'
8+
import { findKey, nth } from 'es-toolkit/compat'
99
import { ref } from 'vue'
1010

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

142142
if (!path) return
143143

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

147-
const filterKeys = Object.entries(modelStore.pressedKeys).filter(
148-
([, value]) => {
149-
return value.includes(dirName)
150-
},
151-
)
152-
153-
for (const [key] of filterKeys) {
154-
handleRelease(key)
155-
}
149+
if (prevKey) {
150+
handleRelease(prevKey)
156151
}
157152

158153
modelStore.pressedKeys[key] = path

src/locales/en-US.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"labels": {
1313
"modelSettings": "Model Settings",
1414
"mirrorMode": "Mirror Mode",
15-
"singleMode": "Single Key Mode",
1615
"mouseMirror": "Mouse Mirror",
1716
"windowSettings": "Window Settings",
1817
"passThrough": "Pass Through",
@@ -28,7 +27,6 @@
2827
},
2928
"hints": {
3029
"mirrorMode": "When enabled, the model will be mirrored horizontally.",
31-
"singleMode": "When enabled, only the last pressed key is displayed for each hand.",
3230
"mouseMirror": "When enabled, the mouse will mirror the hand movement.",
3331
"motionSound": "When enabled, the model will play corresponding sound effects when performing actions (if they exist).",
3432
"behavior": "When enabled, motions and expressions can be configured and triggered.",

src/locales/pt-BR.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"labels": {
1313
"modelSettings": "Configurações do Modelo",
1414
"mirrorMode": "Modo Espelho",
15-
"singleMode": "Mostrar Apenas Última Tecla",
1615
"mouseMirror": "Espelho do Mouse",
1716
"windowSettings": "Configurações da Janela",
1817
"passThrough": "Janela Transparente",
@@ -28,7 +27,6 @@
2827
},
2928
"hints": {
3029
"mirrorMode": "Quando ativado, o modelo será invertido horizontalmente.",
31-
"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).",
3230
"mouseMirror": "Quando ativado, o mouse espelhará o movimento da mão.",
3331
"motionSound": "Quando ativado, o modelo reproduzirá efeitos sonoros correspondentes ao executar ações (se existirem).",
3432
"behavior": "Quando ativado, movimentos e expressões podem ser configurados e acionados.",

src/locales/vi-VN.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"labels": {
1313
"modelSettings": "Cài đặt Mô hình",
1414
"mirrorMode": "Chế độ gương",
15-
"singleMode": "Chỉ hiển thị phím cuối cùng",
1615
"mouseMirror": "Phản chiếu chuột",
1716
"windowSettings": "Cài đặt Cửa sổ",
1817
"passThrough": "Click xuyên",
@@ -28,7 +27,6 @@
2827
},
2928
"hints": {
3029
"mirrorMode": "Bật để lật ngang mô hình.",
31-
"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).",
3230
"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ế.",
3331
"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).",
3432
"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.",

src/locales/zh-CN.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"labels": {
1313
"modelSettings": "模型设置",
1414
"mirrorMode": "镜像模式",
15-
"singleMode": "单键模式",
1615
"mouseMirror": "鼠标镜像",
1716
"windowSettings": "窗口设置",
1817
"passThrough": "窗口穿透",
@@ -28,7 +27,6 @@
2827
},
2928
"hints": {
3029
"mirrorMode": "启用后,模型将水平镜像翻转。",
31-
"singleMode": "启用后,每只手只显示最后按下的一个按键。",
3230
"mouseMirror": "启用后,鼠标将镜像跟随手部移动。",
3331
"motionSound": "启用后,模型执行动作时会播放对应音效(如果存在)。",
3432
"behavior": "启用后,可以配置和触发模型的动作与表情。",

src/locales/zh-TW.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"labels": {
1313
"modelSettings": "模型設定",
1414
"mirrorMode": "鏡像模式",
15-
"singleMode": "單鍵模式",
1615
"mouseMirror": "滑鼠游標鏡像",
1716
"windowSettings": "視窗設定",
1817
"passThrough": "視窗穿透",
@@ -28,7 +27,6 @@
2827
},
2928
"hints": {
3029
"mirrorMode": "啟用後,模型將水平鏡像翻轉。",
31-
"singleMode": "啟用後,每隻手只顯示最後按下的一個按鍵。",
3230
"mouseMirror": "啟用後,滑鼠游標將鏡像跟隨手部移動。",
3331
"motionSound": "啟用後,模型執行動作時會播放對應音效(如果存在)。",
3432
"behavior": "啟用後,可以配置和觸發模型的動作與表情。",

src/pages/preference/components/cat/index.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ const catStore = useCatStore()
1818
<Switch v-model:checked="catStore.model.mirror" />
1919
</ProListItem>
2020

21-
<ProListItem
22-
:description="$t('pages.preference.cat.hints.singleMode')"
23-
:title="$t('pages.preference.cat.labels.singleMode')"
24-
>
25-
<Switch v-model:checked="catStore.model.single" />
26-
</ProListItem>
27-
2821
<ProListItem
2922
:description="$t('pages.preference.cat.hints.mouseMirror')"
3023
:title="$t('pages.preference.cat.labels.mouseMirror')"

src/stores/cat.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { reactive, ref } from 'vue'
44
export interface CatStore {
55
model: {
66
mirror: boolean
7-
single: boolean
87
mouseMirror: boolean
98
motionSound: boolean
109
behavior: boolean
@@ -28,9 +27,6 @@ export const useCatStore = defineStore('cat', () => {
2827
/** @deprecated 请使用 `model.mirror` */
2928
const mirrorMode = ref(false)
3029

31-
/** @deprecated 请使用 `model.single` */
32-
const singleMode = ref(false)
33-
3430
/** @deprecated 请使用 `model.mouseMirror` */
3531
const mouseMirror = ref(false)
3632

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

5248
const model = reactive<CatStore['model']>({
5349
mirror: false,
54-
single: false,
5550
mouseMirror: false,
5651
motionSound: true,
5752
behavior: true,
@@ -73,7 +68,6 @@ export const useCatStore = defineStore('cat', () => {
7368
if (migrated.value) return
7469

7570
model.mirror = mirrorMode.value
76-
model.single = singleMode.value
7771
model.mouseMirror = mouseMirror.value
7872

7973
window.visible = true

0 commit comments

Comments
 (0)