aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/mainmenu/dlg_settings_advanced.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua
index b784a295e..7d524eb80 100644
--- a/builtin/mainmenu/dlg_settings_advanced.lua
+++ b/builtin/mainmenu/dlg_settings_advanced.lua
@@ -752,6 +752,18 @@ local function handle_change_setting_buttons(this, fields)
core.update_formspec(this:get_formspec())
return true
end
+ if setting.min and new_value < setting.min then
+ this.data.error_message = fgettext_ne("The value must be at least $1.", setting.min)
+ this.data.entered_text = fields["te_setting_value"]
+ core.update_formspec(this:get_formspec())
+ return true
+ end
+ if setting.max and new_value > setting.max then
+ this.data.error_message = fgettext_ne("The value must not be larger than $1.", setting.max)
+ this.data.entered_text = fields["te_setting_value"]
+ core.update_formspec(this:get_formspec())
+ return true
+ end
core.settings:set(setting.name, new_value)
elseif setting.type == "flags" then