Changeset - r28773:0150d0acc334
[Not reviewed]
master
0 6 0
Rubidium - 2 months ago 2024-02-08 20:42:34
rubidium@openttd.org
Change: Remove saving of digit group and decimal separator configurations from the savegame
6 files changed with 13 insertions and 36 deletions:
0 comments (0 inline, 0 general)
src/saveload/compat/settings_sl_compat.h
Show inline comments
 
@@ -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 */
src/settings_type.h
Show inline comments
 
@@ -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 */
src/strings.cpp
Show inline comments
 
@@ -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;
 
}
src/table/settings/gui_settings.ini
Show inline comments
 
@@ -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(); }
src/table/settings/locale_settings.ini
Show inline comments
 
@@ -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
src/table/settings/old_gameopt_settings.ini
Show inline comments
 
@@ -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),
0 comments (0 inline, 0 general)