# HG changeset patch # User Rubidium # Date 2024-02-08 20:42:34 # Node ID 0150d0acc334cf2a07ccd5c0836d928b98ec7921 # Parent 5bdd1bea8cf027103d09f92458e3754fb6339807 Change: Remove saving of digit group and decimal separator configurations from the savegame diff --git a/src/saveload/compat/settings_sl_compat.h b/src/saveload/compat/settings_sl_compat.h --- a/src/saveload/compat/settings_sl_compat.h +++ b/src/saveload/compat/settings_sl_compat.h @@ -258,9 +258,9 @@ const SaveLoadCompat _settings_sl_compat SLC_VAR("locale.units_volume"), SLC_VAR("locale.units_force"), SLC_VAR("locale.units_height"), - SLC_VAR("locale.digit_group_separator"), - SLC_VAR("locale.digit_group_separator_currency"), - SLC_VAR("locale.digit_decimal_separator"), + SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS), + SLC_NULL_STR(1, SLV_118, SLV_TABLE_CHUNKS), + SLC_NULL_STR(1, SLV_126, SLV_TABLE_CHUNKS), }; #endif /* SAVELOAD_COMPAT_SETTINGS_H */ diff --git a/src/settings_type.h b/src/settings_type.h --- a/src/settings_type.h +++ b/src/settings_type.h @@ -222,6 +222,8 @@ struct GUISettings { 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 * @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_force; ///< unit system for force 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 */ diff --git a/src/strings.cpp b/src/strings.cpp --- a/src/strings.cpp +++ b/src/strings.cpp @@ -382,7 +382,7 @@ void SetDParamStr(size_t n, std::string 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; return decimal_separator; } diff --git a/src/table/settings/gui_settings.ini b/src/table/settings/gui_settings.ini --- a/src/table/settings/gui_settings.ini +++ b/src/table/settings/gui_settings.ini @@ -28,6 +28,7 @@ static const SettingVariant _gui_setting 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_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] SDTC_OMANY = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size"); @@ -903,3 +904,9 @@ post_cb = [](auto) { SetupWidgetDimensi cat = SC_BASIC 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(); } diff --git a/src/table/settings/locale_settings.ini b/src/table/settings/locale_settings.ini --- a/src/table/settings/locale_settings.ini +++ b/src/table/settings/locale_settings.ini @@ -23,7 +23,6 @@ static const SettingVariant _locale_sett [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), 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] 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 strhelp = STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_HELPTEXT 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 diff --git a/src/table/settings/old_gameopt_settings.ini b/src/table/settings/old_gameopt_settings.ini --- a/src/table/settings/old_gameopt_settings.ini +++ b/src/table/settings/old_gameopt_settings.ini @@ -32,7 +32,6 @@ static const SettingVariant _old_gameopt [templates] 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), -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), 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),