Skip to content

Commit cd6fb31

Browse files
committed
feat: IO Keymap 相关选项优化
1 parent 46314f2 commit cd6fb31

File tree

10 files changed

+145
-28
lines changed

10 files changed

+145
-28
lines changed

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,11 @@
2424
"MaiChartManager/Front/src/locales"
2525
],
2626
"i18n-ally.sourceLanguage": "zh",
27-
"i18n-ally.keystyle": "nested"
27+
"i18n-ally.keystyle": "nested",
28+
"favorites.resources": [
29+
{
30+
"filePath": "MaiChartManager\\Front\\package.json",
31+
"group": "Default"
32+
}
33+
]
2834
}

AquaMai

MaiChartManager/Front/src/components/ModManager/ConfigEntry.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export default defineComponent({
1818
const { t, te } = useI18n();
1919

2020
const optionsIoKeyMap = [
21-
{ label: t('mod.adxHid.disabled'), value: 'None' },
22-
{ label: t('mod.adxHid.select'), value: 'Select' },
23-
{ label: t('mod.adxHid.select1P'), value: 'Select1P' },
24-
{ label: t('mod.adxHid.select2P'), value: 'Select2P' },
25-
{ label: t('mod.adxHid.service'), value: 'Service' },
26-
{ label: t('mod.adxHid.test'), value: 'Test' },
21+
{ label: t('mod.ioKeyMap.disabled'), value: 'None' },
22+
{ label: t('mod.ioKeyMap.select'), value: 'Select' },
23+
{ label: t('mod.ioKeyMap.select1P'), value: 'Select1P' },
24+
{ label: t('mod.ioKeyMap.select2P'), value: 'Select2P' },
25+
{ label: t('mod.ioKeyMap.service'), value: 'Service' },
26+
{ label: t('mod.ioKeyMap.test'), value: 'Test' },
2727
];
2828

2929
const optionsSoundChannel = ['None', 'P1SpeakerLeft', 'P1SpeakerRight', 'P1HeadphoneLeft', 'P1HeadphoneRight', 'P2SpeakerLeft', 'P2SpeakerRight', 'P2HeadphoneLeft', 'P2HeadphoneRight']

MaiChartManager/Front/src/components/ModManager/modComments.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ sectionNameEn:
3030
过新过热: Too New Too Hot
3131
不建议关闭: Not Recommend to Disable
3232

33-
customPanelPosition:
34-
GameSystem.MaimollerIO: top
33+
customPanelPosition: {}

MaiChartManager/Front/src/components/ModManager/sectionPanelOverride/GameSystem.AdxHidInput/index.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { defineComponent, PropType, ref, computed, h } from 'vue';
2-
import { IEntryState, ISectionState } from "@/client/apiGen";
2+
import { IEntryState, ISectionState, Section } from "@/client/apiGen";
33
import { NButton, NFlex, NFormItem, NGrid, NGridItem, NSelect } from "naive-ui";
44
import api from "@/client/api";
55
import { modInfo, updateModInfo } from "@/store/refs";
66
import { useI18n } from 'vue-i18n';
7+
import ConfigEntry from '../../ConfigEntry';
78

89
export default defineComponent({
910
props: {
11+
section: { type: Object as PropType<Section>, required: true },
1012
entryStates: { type: Object as PropType<Record<string, IEntryState>>, required: true },
1113
sectionState: { type: Object as PropType<ISectionState>, required: true },
1214
},
@@ -15,12 +17,12 @@ export default defineComponent({
1517
const { t } = useI18n();
1618

1719
const options = [
18-
{ label: t('mod.adxHid.disabled'), value: 'None' },
19-
{ label: t('mod.adxHid.select'), value: 'Select' },
20-
{ label: t('mod.adxHid.select1P'), value: 'Select1P' },
21-
{ label: t('mod.adxHid.select2P'), value: 'Select2P' },
22-
{ label: t('mod.adxHid.service'), value: 'Service' },
23-
{ label: t('mod.adxHid.test'), value: 'Test' },
20+
{ label: t('mod.ioKeyMap.disabled'), value: 'None' },
21+
{ label: t('mod.ioKeyMap.select'), value: 'Select' },
22+
{ label: t('mod.ioKeyMap.select1P'), value: 'Select1P' },
23+
{ label: t('mod.ioKeyMap.select2P'), value: 'Select2P' },
24+
{ label: t('mod.ioKeyMap.service'), value: 'Service' },
25+
{ label: t('mod.ioKeyMap.test'), value: 'Test' },
2426
];
2527

2628
const del = async () => {
@@ -72,6 +74,12 @@ export default defineComponent({
7274
</NFlex>
7375
</NGridItem>
7476
</NGrid>
77+
<NFlex vertical class="p-l-3">
78+
{props.section.entries?.filter(it=>
79+
['GameSystem.AdxHidInput.DisableButtons']
80+
.includes(it.path!))
81+
.map((entry) => <ConfigEntry key={entry.path!} entry={entry} entryState={props.entryStates[entry.path!]}/>)}
82+
</NFlex>
7583
</NFlex>
7684
},
7785
});

MaiChartManager/Front/src/components/ModManager/sectionPanelOverride/GameSystem.KeyMap/index.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ export default defineComponent({
4949
</NGridItem>
5050
</NGrid>
5151
<NFlex vertical class="p-l-15">
52+
{props.section.entries?.some(it=>it.path === 'GameSystem.KeyMap.DisableIO4_1P') &&
53+
<NFormItem label={t('mod.keyMap.disableIO4')} labelPlacement="left" labelWidth="9em" showFeedback={false}>
54+
<NFlex vertical class="w-full ws-pre-line">
55+
<div class='flex gap-4 h-34px items-center'>
56+
<div class="flex items-center gap-2">
57+
<NSwitch v-model:value={props.entryStates['GameSystem.KeyMap.DisableIO4_1P'].value}/>
58+
1P
59+
</div>
60+
<div class="flex items-center gap-2">
61+
<NSwitch v-model:value={props.entryStates['GameSystem.KeyMap.DisableIO4_2P'].value}/>
62+
2P
63+
</div>
64+
<div class="flex items-center gap-2">
65+
<NSwitch v-model:value={props.entryStates['GameSystem.KeyMap.DisableIO4System'].value}/>
66+
{t('mod.keyMap.disableIO4System')}
67+
</div>
68+
</div>
69+
{t('mod.keyMap.disableIO4Tip')}
70+
</NFlex>
71+
</NFormItem>}
5272
{props.section.entries?.filter(it=>
5373
['GameSystem.KeyMap.Autoplay','GameSystem.KeyMap.DisableIO4','GameSystem.KeyMap.DisableDebugInput','GameSystem.KeyMap.DisableDebugFeatureHotkeys']
5474
.includes(it.path!))
Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import api from '@/client/api';
2+
import { Entry, IEntryState, ISectionState, Section } from '@/client/apiGen';
23
import { t } from '@/locales';
34
import { globalCapture, modInfo, updateModInfo } from '@/store/refs';
45
import { useAsyncState } from '@vueuse/core';
5-
import { NFlex, NButton } from 'naive-ui';
6+
import { NFlex, NButton, NGrid, NGridItem, NFormItem, NSelect, NSwitch } from 'naive-ui';
67
import { defineComponent, PropType, ref, computed, watch } from 'vue';
78

89
export default defineComponent({
9-
// props: {
10-
// },
10+
props: {
11+
section: { type: Object as PropType<Section>, required: true },
12+
entryStates: {type: Object as PropType<Record<string, IEntryState>>, required: true},
13+
sectionState: {type: Object as PropType<ISectionState>, required: true},
14+
},
1115
setup(props, { emit }) {
1216
const install = useAsyncState(async () => {
1317
await api.InstallMmlLibs();
@@ -19,14 +23,78 @@ export default defineComponent({
1923
},
2024
})
2125

22-
return () => <div class="">
26+
const options = [
27+
{ label: t('mod.ioKeyMap.disabled'), value: 'None' },
28+
{ label: t('mod.ioKeyMap.select'), value: 'Select' },
29+
{ label: t('mod.ioKeyMap.select1P'), value: 'Select1P' },
30+
{ label: t('mod.ioKeyMap.select2P'), value: 'Select2P' },
31+
{ label: t('mod.ioKeyMap.service'), value: 'Service' },
32+
{ label: t('mod.ioKeyMap.test'), value: 'Test' },
33+
];
34+
35+
const PREFIX = 'GameSystem.MaimollerIO.';
36+
37+
return () => <NFlex vertical>
2338
{!modInfo.value?.isMmlLibInstalled ? <NFlex align="center" class="m-l-35">
2439
<span class="c-orange">{t('mod.mmlIo.notInstalled')}</span>
2540
<NButton secondary onClick={() => install.execute()} loading={install.isLoading.value}>{t('mod.mmlIo.oneClickInstall')}</NButton>
2641
</NFlex>
2742
: <NFlex align="center" class="m-l-35">
2843
<span class="c-green-6">{t('mod.mmlIo.installed')}</span>
2944
</NFlex>}
30-
</div>;
45+
<div class="m-l-35">
46+
{t('mod.mmlIo.tip')}
47+
</div>
48+
<NGrid cols="1 500:2" yGap="12px">
49+
<NGridItem>
50+
<NFlex vertical>
51+
{props.section.entries?.filter(it=>
52+
['P1', 'Touch1p', 'Button1p', 'Led1p'].map(it=>PREFIX + it).includes(it.path!))
53+
.map((entry) => {
54+
return <NFormItem label={t(`mod.mmlIo.${entry.path!.split('.').pop()}`)} labelPlacement="left" labelWidth="10em" showFeedback={false}>
55+
<div class="flex h-34px items-center">
56+
<NSwitch v-model:value={props.entryStates[entry.path!].value}/>
57+
</div>
58+
</NFormItem>
59+
})
60+
}
61+
<NFormItem label={t('mod.mmlIo.button1')} labelPlacement="left" labelWidth="10em" showFeedback={false}>
62+
<NFlex vertical class="w-full ws-pre-line">
63+
<NSelect v-model:value={props.entryStates[PREFIX + 'Button1'].value} options={options}/>
64+
</NFlex>
65+
</NFormItem>
66+
<NFormItem label={t('mod.mmlIo.button2')} labelPlacement="left" labelWidth="10em" showFeedback={false}>
67+
<NFlex vertical class="w-full ws-pre-line">
68+
<NSelect v-model:value={props.entryStates[PREFIX + 'Button2'].value} options={options}/>
69+
</NFlex>
70+
</NFormItem>
71+
</NFlex>
72+
</NGridItem>
73+
<NGridItem>
74+
<NFlex vertical>
75+
{props.section.entries?.filter(it=>
76+
['P2', 'Touch2p', 'Button2p', 'Led2p'].map(it=>PREFIX + it).includes(it.path!))
77+
.map((entry) => {
78+
return <NFormItem label={t(`mod.mmlIo.${entry.path!.split('.').pop()}`)} labelPlacement="left" labelWidth="10em" showFeedback={false}>
79+
<div class="flex h-34px items-center">
80+
<NSwitch v-model:value={props.entryStates[entry.path!].value}/>
81+
</div>
82+
</NFormItem>
83+
})
84+
}
85+
<NFormItem label={t('mod.mmlIo.button3')} labelPlacement="left" labelWidth="10em" showFeedback={false}>
86+
<NFlex vertical class="w-full ws-pre-line">
87+
<NSelect v-model:value={props.entryStates[PREFIX + 'Button3'].value} options={options}/>
88+
</NFlex>
89+
</NFormItem>
90+
<NFormItem label={t('mod.mmlIo.button4')} labelPlacement="left" labelWidth="10em" showFeedback={false}>
91+
<NFlex vertical class="w-full ws-pre-line">
92+
<NSelect v-model:value={props.entryStates[PREFIX + 'Button4'].value} options={options}/>
93+
</NFlex>
94+
</NFormItem>
95+
</NFlex>
96+
</NGridItem>
97+
</NGrid>
98+
</NFlex>;
3199
},
32100
});

MaiChartManager/Front/src/locales/en.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,7 @@ mod:
372372
After enabling this, the settings in Test menu will no longer work, but
373373
you can still test (testing requires disabling 1P mode)
374374
375-
If your cabinet has corresponding host software, it's recommended to use
376-
it for adjustments
375+
If your controller has corresponding host software, it's recommended to disable this option and use the host software for adjustments
377376
configCorrupted: AquaMai config file corrupted
378377
configCorruptedMessage: Please manually check AquaMai.toml and try to fix possible issues
379378
resetToDefault: Reset to default settings

MaiChartManager/Front/src/locales/zh-TW.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ mod:
338338
GameSettings_TouchSensitivity: |
339339
使用自訂的觸控靈敏度
340340
這裡啟用之後 Test 裡的設定就不再起作用了,不過還是可以使用 Test 測試(使用測試需要關閉 1P 模式)
341-
如果你的手台有對應的上位機,建議使用上位機調整
341+
如果你的手台有對應的上位機,建議關閉本選項並使用上位機調整
342342
configCorrupted: AquaMai 設定檔損壞
343343
configCorruptedMessage: 請手動檢查 AquaMai.toml 並嘗試修復可能的問題
344344
resetToDefault: 重設回預設設定

MaiChartManager/Front/src/locales/zh.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,14 @@ mod:
281281
availableVersion: 可安装
282282
killGameProcess: 关闭游戏进程
283283
needInstallOrUpdate: AquaMai 未安装或需要更新
284-
adxHid:
284+
ioKeyMap:
285285
disabled: 禁用
286+
select: 选择
286287
select1P: 1P 选择
287288
select2P: 2P 选择
288289
service: 服务
289290
test: 测试
291+
adxHid:
290292
conflictDetected: 检测到冲突的 Mod
291293
oneClickDelete: 一键删除
292294
noConflict: 没有检测到冲突
@@ -298,7 +300,6 @@ mod:
298300
button3Desc: 向下的三角键
299301
button4: 按键 4
300302
button4Desc: 最下方的圆形按键
301-
select: 选择
302303
touchSensitivity:
303304
applyPresetToGlobal: 应用预设到全局
304305
settingsFor: '{area} 的灵敏度设置'
@@ -317,6 +318,9 @@ mod:
317318
button2P: 2P 按键 {index}
318319
select1P: 1P 选择键
319320
select2P: 2P 选择键
321+
disableIO4: 禁用 IO4 输入
322+
disableIO4Tip: 开关打开为禁用对应输入。在禁用 IO4 输入后,你的兼容 IO4 板或 segatools IO4 模拟将被忽略。
323+
disableIO4System: 系统按键(测试、服务)
320324
soundChannel:
321325
P1SpeakerLeft: 1P 外放左
322326
P1SpeakerRight: 1P 外放右
@@ -338,7 +342,7 @@ mod:
338342
GameSettings_TouchSensitivity: |
339343
使用自定义的触摸灵敏度
340344
这里启用之后 Test 里的设置就不再起作用了,不过还是可以使用 Test 测试(使用测试需要关闭 1P 模式)
341-
如果你的手台有对应的上位机,建议使用上位机调整
345+
如果你的手台有对应的上位机,建议关闭本选项并使用上位机调整
342346
configCorrupted: AquaMai 配置文件损坏
343347
configCorruptedMessage: 请手动检查 AquaMai.toml 并尝试修复可能的问题
344348
resetToDefault: 重置回默认设置
@@ -371,6 +375,19 @@ mod:
371375
oneClickInstall: 一键安装
372376
installed: 已正确安装
373377
installFailed: 安装 Maimoller 依赖库时出现错误
378+
button1: 按钮 1(三角形)
379+
button2: 按钮 2(圆形)
380+
button3: 按钮 3(圆形)
381+
button4: 按钮 4(圆形)
382+
Touch1p: 1P 触屏
383+
Touch2p: 2P 触屏
384+
Button1p: 1P 按键
385+
Button2p: 2P 按键
386+
Led1p: 1P 灯光
387+
Led2p: 2P 灯光
388+
P1: 启用 1P
389+
P2: 启用 2P
390+
tip: 如果混用 Maimoller 与其他协议,请对不是 Maimoller 的一侧禁用
374391
tools:
375392
title: 工具
376393
audioConvert: 音频转换(ACB + AWB)

0 commit comments

Comments
 (0)