mirror of https://github.com/OpenTTD/OpenTTD
Change: Remove saving of digit group and decimal separator configurations from the savegame
parent
e67fc33172
commit
609d0071d5
|
@ -258,9 +258,9 @@ const SaveLoadCompat _settings_sl_compat[] = {
|
||||||
SLC_VAR("locale.units_volume"),
|
SLC_VAR("locale.units_volume"),
|
||||||
SLC_VAR("locale.units_force"),
|
SLC_VAR("locale.units_force"),
|
||||||
SLC_VAR("locale.units_height"),
|
SLC_VAR("locale.units_height"),
|
||||||
SLC_VAR("locale.digit_group_separator"),
|
SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS),
|
||||||
SLC_VAR("locale.digit_group_separator_currency"),
|
SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS),
|
||||||
SLC_VAR("locale.digit_decimal_separator"),
|
SLC_NULL_STR(1, SLV_126, SLV_TABLE_CHUNKS),
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SAVELOAD_COMPAT_SETTINGS_H */
|
#endif /* SAVELOAD_COMPAT_SETTINGS_H */
|
||||||
|
|
|
@ -222,6 +222,8 @@ struct GUISettings {
|
||||||
|
|
||||||
bool scale_bevels; ///< bevels are scaled with GUI scale.
|
bool scale_bevels; ///< bevels are scaled with GUI scale.
|
||||||
|
|
||||||
|
std::string digit_decimal_separator; ///< decimal separator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true when the user has sufficient privileges to edit newgrfs on a running game
|
* Returns true when the user has sufficient privileges to edit newgrfs on a running game
|
||||||
* @return whether the user has sufficient privileges to edit newgrfs in an existing game
|
* @return whether the user has sufficient privileges to edit newgrfs in an existing game
|
||||||
|
@ -265,9 +267,6 @@ struct LocaleSettings {
|
||||||
byte units_volume; ///< unit system for volume
|
byte units_volume; ///< unit system for volume
|
||||||
byte units_force; ///< unit system for force
|
byte units_force; ///< unit system for force
|
||||||
byte units_height; ///< unit system for height
|
byte units_height; ///< unit system for height
|
||||||
std::string digit_group_separator; ///< thousand separator for non-currencies
|
|
||||||
std::string digit_group_separator_currency; ///< thousand separator for currencies
|
|
||||||
std::string digit_decimal_separator; ///< decimal separator
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Settings related to news */
|
/** Settings related to news */
|
||||||
|
|
|
@ -382,7 +382,7 @@ void SetDParamStr(size_t n, std::string &&str)
|
||||||
|
|
||||||
static const char *GetDecimalSeparator()
|
static const char *GetDecimalSeparator()
|
||||||
{
|
{
|
||||||
const char *decimal_separator = _settings_game.locale.digit_decimal_separator.c_str();
|
const char *decimal_separator = _settings_client.gui.digit_decimal_separator.c_str();
|
||||||
if (StrEmpty(decimal_separator)) decimal_separator = _langpack.langpack->digit_decimal_separator;
|
if (StrEmpty(decimal_separator)) decimal_separator = _langpack.langpack->digit_decimal_separator;
|
||||||
return decimal_separator;
|
return decimal_separator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ static const SettingVariant _gui_settings_table[] = {
|
||||||
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTC_BOOL = SDTC_BOOL( $var, $flags, $def, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTC_VAR = SDTC_VAR( $var, $type, $flags, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
|
SDTC_SSTR = SDTC_SSTR( $var, $type, $flags, $def, 0, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
|
||||||
|
|
||||||
[validation]
|
[validation]
|
||||||
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
|
SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
|
||||||
|
@ -903,3 +904,9 @@ post_cb = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); }
|
||||||
cat = SC_BASIC
|
cat = SC_BASIC
|
||||||
startup = true
|
startup = true
|
||||||
|
|
||||||
|
[SDTC_SSTR]
|
||||||
|
var = gui.digit_decimal_separator
|
||||||
|
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
|
||||||
|
type = SLE_STRQ
|
||||||
|
def = nullptr
|
||||||
|
post_cb = [](auto) { MarkWholeScreenDirty(); }
|
||||||
|
|
|
@ -23,7 +23,6 @@ static const SettingVariant _locale_settings_table[] = {
|
||||||
[templates]
|
[templates]
|
||||||
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
|
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
|
||||||
SDT_SSTR = SDT_SSTR(GameSettings, $var, $type, $flags, $def, $pre_cb, $post_cb, $from, $to, $cat, $extra, $startup),
|
|
||||||
|
|
||||||
[validation]
|
[validation]
|
||||||
SDTG_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
|
SDTG_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
|
||||||
|
@ -169,30 +168,3 @@ cat = SC_BASIC
|
||||||
str = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT
|
str = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT
|
||||||
strhelp = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_HELPTEXT
|
strhelp = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_HELPTEXT
|
||||||
strval = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_IMPERIAL
|
strval = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_IMPERIAL
|
||||||
|
|
||||||
[SDT_SSTR]
|
|
||||||
var = locale.digit_group_separator
|
|
||||||
type = SLE_STRQ
|
|
||||||
from = SLV_118
|
|
||||||
flags = SF_NO_NETWORK_SYNC
|
|
||||||
def = nullptr
|
|
||||||
post_cb = [](auto) { MarkWholeScreenDirty(); }
|
|
||||||
cat = SC_BASIC
|
|
||||||
|
|
||||||
[SDT_SSTR]
|
|
||||||
var = locale.digit_group_separator_currency
|
|
||||||
type = SLE_STRQ
|
|
||||||
from = SLV_118
|
|
||||||
flags = SF_NO_NETWORK_SYNC
|
|
||||||
def = nullptr
|
|
||||||
post_cb = [](auto) { MarkWholeScreenDirty(); }
|
|
||||||
cat = SC_BASIC
|
|
||||||
|
|
||||||
[SDT_SSTR]
|
|
||||||
var = locale.digit_decimal_separator
|
|
||||||
type = SLE_STRQ
|
|
||||||
from = SLV_126
|
|
||||||
flags = SF_NO_NETWORK_SYNC
|
|
||||||
def = nullptr
|
|
||||||
post_cb = [](auto) { MarkWholeScreenDirty(); }
|
|
||||||
cat = SC_BASIC
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ static const SettingVariant _old_gameopt_settings_table[] = {
|
||||||
[templates]
|
[templates]
|
||||||
SDTG_LIST = SDTG_LIST($name, $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
|
SDTG_LIST = SDTG_LIST($name, $type, $flags, $var, $def, $length, $from, $to, $cat, $extra, $startup),
|
||||||
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTG_VAR = SDTG_VAR($name, $type, $flags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDT_NULL = SDT_NULL( $length, $from, $to),
|
|
||||||
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTC_OMANY = SDTC_OMANY( $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $var, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $cat, $extra, $startup),
|
||||||
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
|
SDT_OMANY = SDT_OMANY(GameSettings, $var, $type, $flags, $def, $max, $full, $str, $strhelp, $strval, $pre_cb, $post_cb, $str_cb, $help_cb, $val_cb, $from, $to, $load, $cat, $extra, $startup),
|
||||||
|
|
Loading…
Reference in New Issue