summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-21 22:00:00 +0000
committerrubidium <rubidium@openttd.org>2009-03-21 22:00:00 +0000
commit900364109597f02413e2f7a59e9b4e6cc9fdf97f (patch)
tree308b7c3eda7e63a306620580ef4df5f4b99b893e /src/news_gui.cpp
parentd452a0a0ecaad276c893b62ab8f008a5af85ba82 (diff)
downloadopenttd-900364109597f02413e2f7a59e9b4e6cc9fdf97f.tar.xz
(svn r15790) -Codechange: remove the *Centered part of the old text drawing API.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index eb81caa7f..1755f03dc 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -57,7 +57,7 @@ static void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
switch (ni->subtype) {
case NS_COMPANY_TROUBLE:
- DrawStringCentered(w->width >> 1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, TC_FROMSTRING);
+ DrawString(0, w->width, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, TC_FROMSTRING, SA_CENTER);
SetDParam(0, ni->params[2]);
@@ -69,7 +69,7 @@ static void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
break;
case NS_COMPANY_MERGER:
- DrawStringCentered(w->width >> 1, 1, STR_7059_TRANSPORT_COMPANY_MERGER, TC_FROMSTRING);
+ DrawString(0, w->width, 1, STR_7059_TRANSPORT_COMPANY_MERGER, TC_FROMSTRING, SA_CENTER);
SetDParam(0, ni->params[2]);
SetDParam(1, ni->params[3]);
SetDParam(2, ni->params[4]);
@@ -81,7 +81,7 @@ static void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
break;
case NS_COMPANY_BANKRUPT:
- DrawStringCentered(w->width >> 1, 1, STR_705C_BANKRUPT, TC_FROMSTRING);
+ DrawString(0, w->width, 1, STR_705C_BANKRUPT, TC_FROMSTRING, SA_CENTER);
SetDParam(0, ni->params[2]);
DrawStringMultiCenter(
((w->width - 101) >> 1) + 98,
@@ -91,7 +91,7 @@ static void DrawNewsBankrupcy(Window *w, const NewsItem *ni)
break;
case NS_COMPANY_NEW:
- DrawStringCentered(w->width >> 1, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, TC_FROMSTRING);
+ DrawString(0, w->width, 1, STR_705E_NEW_TRANSPORT_COMPANY_LAUNCHED, TC_FROMSTRING, SA_CENTER);
SetDParam(0, ni->params[2]);
SetDParam(1, ni->params[3]);
DrawStringMultiCenter(
@@ -842,9 +842,7 @@ struct MessageOptionsWindow : Window {
/* Draw the string of each setting on each button. */
for (int i = 0, y = 26; i < NT_END; i++, y += 12) {
- /* 51 comes from 13 + 89 (left and right of the button)+1, shiefted by one as to get division,
- * which will give centered position */
- DrawStringCentered(51, y + 1, _message_opt[_news_type_data[i].display], TC_BLACK);
+ DrawString(this->widget[WIDGET_NEWSOPT_START_OPTION + 1].left, this->widget[WIDGET_NEWSOPT_START_OPTION + 1].right, y + 1, _message_opt[_news_type_data[i].display], TC_BLACK, SA_CENTER);
}
}