summaryrefslogtreecommitdiff
path: root/src/settings_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-03-24 20:03:02 +0000
committeryexo <yexo@openttd.org>2009-03-24 20:03:02 +0000
commit84fb615344af1d998ae607aea7801d74a3b90e4e (patch)
tree70b7dee14892374c8be6116a56e3cddf0ec43b54 /src/settings_gui.cpp
parent306239ee3e8376c1c85e80e5b7960e0ba488ad32 (diff)
downloadopenttd-84fb615344af1d998ae607aea7801d74a3b90e4e.tar.xz
(svn r15835) -Codechange: Prevent using the return value of DrawString as much as possible.
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r--src/settings_gui.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 3f7c5f8ff..494f54137 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1496,7 +1496,6 @@ struct CustomCurrencyWindow : Window {
virtual void OnPaint()
{
int const right = this->width - 1;
- int x;
int y = 20;
this->DrawWidgets();
@@ -1509,20 +1508,20 @@ struct CustomCurrencyWindow : Window {
/* separator */
DrawFrameRect(10, y + 1, 29, y + 9, COLOUR_DARK_BLUE, GB(this->click, 2, 2) ? FR_LOWERED : FR_NONE);
- x = DrawString(35, right, y + 1, STR_CURRENCY_SEPARATOR, TC_FROMSTRING);
- DrawString(x + 4, right, y + 1, this->separator, TC_ORANGE);
+ SetDParamStr(0, this->separator);
+ DrawString(35, right, y + 1, STR_CURRENCY_SEPARATOR, TC_FROMSTRING);
y += 12;
/* prefix */
DrawFrameRect(10, y + 1, 29, y + 9, COLOUR_DARK_BLUE, GB(this->click, 4, 2) ? FR_LOWERED : FR_NONE);
- x = DrawString(35, right, y + 1, STR_CURRENCY_PREFIX, TC_FROMSTRING);
- DrawString(right, x + 4, y + 1, _custom_currency.prefix, TC_ORANGE);
+ SetDParamStr(0, _custom_currency.prefix);
+ DrawString(35, right, y + 1, STR_CURRENCY_PREFIX, TC_FROMSTRING);
y += 12;
/* suffix */
DrawFrameRect(10, y + 1, 29, y + 9, COLOUR_DARK_BLUE, GB(this->click, 6, 2) ? FR_LOWERED : FR_NONE);
- x = DrawString(35, right, y + 1, STR_CURRENCY_SUFFIX, TC_FROMSTRING);
- DrawString(x + 4, right, y + 1, _custom_currency.suffix, TC_ORANGE);
+ SetDParamStr(0, _custom_currency.suffix);
+ DrawString(35, right, y + 1, STR_CURRENCY_SUFFIX, TC_FROMSTRING);
y += 12;
/* switch to euro */