Revert #11993: new number format system does not and cannot work for CJK languages

There are too many intricacies that I am unaware of that are popping up after
asking whether things are right or not.
I do not want to keep playing whack-a-mole, so just revert the whole thing.

This reverts:
15be383b93
360fe8b0b6
1aa9a5c0ab
59f56941e5
7e2eefb91f
b741b2ba6f
609d0071d5
9f8fd80112
a253205b93
819c6c756e
This commit is contained in:
Rubidium
2024-02-22 18:08:33 +01:00
committed by rubidium42
parent 8015d96a50
commit 4c117dd2d8
81 changed files with 313 additions and 425 deletions

View File

@@ -43,6 +43,12 @@ def = 1
min = 0
max = UINT16_MAX
[SDT_SSTR]
var = separator
type = SLE_STRQ
def = "".""
cat = SC_BASIC
[SDT_VAR]
var = to_euro
type = SLE_INT32

View File

@@ -16,7 +16,6 @@ static void InvalidateCompanyLiveryWindow(int32_t new_value);
static void InvalidateNewGRFChangeWindows(int32_t new_value);
static void ZoomMinMaxChanged(int32_t new_value);
static void SpriteZoomMinChanged(int32_t new_value);
void InitializeNumberFormats();
static constexpr std::initializer_list<const char*> _osk_activation{"disabled", "double", "single", "immediately"};
static constexpr std::initializer_list<const char*> _savegame_date{"long", "short", "iso"};
@@ -29,7 +28,6 @@ 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_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");
@@ -905,27 +903,3 @@ post_cb = [](auto) { SetupWidgetDimensions(); ReInitAllWindows(true); }
cat = SC_BASIC
startup = true
[SDTC_SSTR]
var = gui.number_format
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
type = SLE_STRQ
def = nullptr
pre_cb = [](auto format) { NumberFormatSeparators separators; return !ParseNumberFormatSeparators(separators, format).has_value(); }
post_cb = [](auto) { InitializeNumberFormats(); MarkWholeScreenDirty(); }
startup = true
[SDTC_SSTR]
var = gui.number_abbreviations
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
type = SLE_STRQ
def = nullptr
pre_cb = [](auto format) { NumberAbbreviations abbreviations; return !ParseNumberAbbreviations(abbreviations, format).has_value(); }
post_cb = [](auto) { InitializeNumberFormats(); MarkWholeScreenDirty(); }
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(); }

View File

@@ -23,6 +23,7 @@ static const SettingVariant _locale_settings_table[] = {
[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");
@@ -168,3 +169,30 @@ 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

View File

@@ -32,6 +32,7 @@ static const SettingVariant _old_gameopt_settings_table[] = {
[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),