Skip to content

Commit bb1a703

Browse files
committed
feat: mod 设置页面 number 的 step
1 parent 3acc4f1 commit bb1a703

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export default defineComponent({
7272

7373
watch(() => show.value, async (val) => {
7474
if (!val && config.value) {
75-
await api.SetAquaMaiConfig(config.value)
75+
try {
76+
await api.SetAquaMaiConfig(config.value)
77+
} catch (e) {
78+
globalCapture(e, "保存 AquaMai 配置失败")
79+
}
7680
}
7781
})
7882

@@ -113,7 +117,7 @@ export default defineComponent({
113117
<NFlex class="h-34px" align="center">
114118
{typeof section[k] === 'boolean' && <NSwitch v-model:value={section[k]}/>}
115119
{typeof section[k] === 'string' && <NInput v-model:value={section[k]} placeholder=""/>}
116-
{typeof section[k] === 'number' && <NInputNumber v-model:value={section[k]} placeholder=""/>}
120+
{typeof section[k] === 'number' && <NInputNumber v-model:value={section[k]} placeholder="" step={comments.steps[k] || 1}/>}
117121
{comments.shouldEnableOptions[key]?.[k] && !section[k] && <ProblemsDisplay problems={['需要开启此选项']}/>}
118122
</NFlex>
119123
{comments[key]?.[k]}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,15 @@ fix:
6262
6363
utils:
6464
logUserId: 在玩家登录时调试输出用户 ID
65+
judgeAdjustA: 全局增加 A 判,单位和游戏里一样
66+
judgeAdjustB: 全局增加 B 判,单位和游戏里一样
67+
touchDelay: 给触摸屏增加额外延迟,单位为毫秒,一秒 = 1000 毫秒。必须是整数
6568

6669
shouldEnableOptions:
6770
ux:
6871
loadAssetsPng: true
6972
loadLocalBga: true
73+
74+
steps:
75+
judgeAdjustA: 0.1
76+
judgeAdjustB: 0.1

MaiChartManager/Front/src/store/refs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const errorId = ref<string>();
88
export const errorContext = ref<string>();
99

1010
export const globalCapture = (err: any, context: string) => {
11+
console.log(err)
1112
error.value = err;
1213
errorContext.value = context;
1314
errorId.value = captureException(err.error || err, {

0 commit comments

Comments
 (0)