From 802d31aab683d1e6baeafd8f53bbe7187b39e69a Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 25 Apr 2009 20:16:56 +0000 Subject: (svn r16144) -Fix (r16129): setting the custom digit grouping separator required to restart OpenTTD to take effect. Now also support non 1 ASCII character custom grouping separators. --- src/settings_gui.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/settings_gui.cpp') diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index ac3af105a..d52ed96c6 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1587,13 +1587,10 @@ enum CustomCurrencyWidgets { }; struct CustomCurrencyWindow : Window { - char separator[2]; int query_widget; CustomCurrencyWindow(const WindowDesc *desc) : Window(desc) { - this->separator[0] = _custom_currency.separator; - this->separator[1] = '\0'; this->FindWindowPlacementAndResize(desc); SetButtonState(); @@ -1611,7 +1608,7 @@ struct CustomCurrencyWindow : Window { { SetDParam(0, 1); SetDParam(1, 1); - SetDParamStr(2, this->separator); + SetDParamStr(2, _custom_currency.separator); SetDParamStr(3, _custom_currency.prefix); SetDParamStr(4, _custom_currency.suffix); SetDParam(5, _custom_currency.to_euro); @@ -1650,7 +1647,7 @@ struct CustomCurrencyWindow : Window { case CUSTCURR_SEPARATOR_EDIT: case CUSTCURR_SEPARATOR: - SetDParamStr(0, this->separator); + SetDParamStr(0, _custom_currency.separator); str = STR_JUST_RAW_STRING; len = 1; line = CUSTCURR_SEPARATOR; @@ -1712,8 +1709,7 @@ struct CustomCurrencyWindow : Window { break; case CUSTCURR_SEPARATOR: // Thousands seperator - _custom_currency.separator = StrEmpty(str) ? ' ' : str[0]; - strecpy(this->separator, str, lastof(this->separator)); + strecpy(_custom_currency.separator, str, lastof(_custom_currency.separator)); break; case CUSTCURR_PREFIX: -- cgit v1.2.3-70-g09d2