diff --git a/src/core/main/init/settings.tsx b/src/core/main/init/settings.tsx index 1654571..ffda9a2 100644 --- a/src/core/main/init/settings.tsx +++ b/src/core/main/init/settings.tsx @@ -60,6 +60,9 @@ function NumberSetting(props: SettingComponentProps) { const { setting, displayer, item } = props; const changeValue = (value: number) => { if (typeof value !== 'number') return; + if (value < (item.step?.[0] ?? 0) || value > (item.step?.[1] ?? 100)) { + return; + } setting.setValue(displayer.selectStack.join('.'), value); displayer.update(); }; diff --git a/src/core/main/setting.ts b/src/core/main/setting.ts index 78e37b4..e109f26 100644 --- a/src/core/main/setting.ts +++ b/src/core/main/setting.ts @@ -312,8 +312,6 @@ export class SettingDisplayer extends EventEmitter { } } -// todo: 优化存储方式 - export const mainSetting = new MotaSetting(); // 添加不参与全局存储的设置 MotaSetting.noStorage.push('action.autoSkill', 'screen.fullscreen'); @@ -516,4 +514,5 @@ mainSetting .setDescription('audio.bgmEnabled', `是否开启背景音乐`) .setDescription('audio.bgmVolume', `背景音乐的音量`) .setDescription('audio.soundEnabled', `是否开启音效`) - .setDescription('audio.soundVolume', `音效的音量`); + .setDescription('audio.soundVolume', `音效的音量`) + .setDescription('ui.mapScale', `楼传小地图的缩放,百分比格式`);