Codechange: Add callback to IntSettingDesc to support dynamic min/max

This commit is contained in:
glx22
2025-01-04 19:49:14 +01:00
committed by Loïc Guilloux
parent bf02cb014b
commit 7493b2d0c1
20 changed files with 81 additions and 48 deletions

View File

@@ -13,7 +13,7 @@ static const SettingVariant _pathfinding_settings_table[] = {
};
[templates]
SDT_BOOL = SDT_BOOL(GameSettings, $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR(GameSettings, $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $def_cb, $range_cb, $from, $to, $cat, $extra, $startup),
[validation]
SDT_VAR = static_assert($max <= MAX_$type, "Maximum value for GameSettings.$var exceeds storage size");
@@ -30,6 +30,7 @@ str_cb = nullptr
help_cb = nullptr
val_cb = nullptr
def_cb = nullptr
range_cb = nullptr
load = nullptr
from = SL_MIN_VERSION
to = SL_MAX_VERSION