summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-08-16 12:32:49 +0000
committerfrosch <frosch@openttd.org>2010-08-16 12:32:49 +0000
commitca6aac6a5a125881ef1d65c3083344314ce81f61 (patch)
tree453d307863d91f19face79661e045f75046466b4
parent8b9a71d45f0c7b01d935d1a8e4cf8bd88b44a53e (diff)
downloadopenttd-ca6aac6a5a125881ef1d65c3083344314ce81f61.tar.xz
(svn r20514) -Fix: Draw error messages in white by default, they may not have a colour code.
-rw-r--r--src/misc_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 1ea0fe566..7806188fc 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -661,13 +661,14 @@ public:
} else {
int extra = (r.bottom - r.top + 1 - this->height_summary - this->height_detailed - WD_PAR_VSEP_WIDE) / 2;
+ /* Note: NewGRF supplied error message often do not start with a colour code, so default to white. */
int top = r.top + WD_FRAMERECT_TOP;
int bottom = top + this->height_summary + extra;
- DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, top, bottom, this->summary_msg, TC_FROMSTRING, SA_CENTER);
+ DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, top, bottom, this->summary_msg, TC_WHITE, SA_CENTER);
bottom = r.bottom - WD_FRAMERECT_BOTTOM;
top = bottom - this->height_detailed - extra;
- DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, top, bottom, this->detailed_msg, TC_FROMSTRING, SA_CENTER);
+ DrawStringMultiLine(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, top, bottom, this->detailed_msg, TC_WHITE, SA_CENTER);
}
SwitchToNormalRefStack(); // Switch back to the normal text ref. stack for NewGRF texts.