From 1d7d177cae6b4539411cd1fbd016999f6671b2b7 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sun, 4 Feb 2024 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=B0=E5=AD=97=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/main/init/settings.tsx | 3 +++ src/core/main/setting.ts | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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', `楼传小地图的缩放,百分比格式`);