summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-06-10 16:37:25 +0000
committerfrosch <frosch@openttd.org>2014-06-10 16:37:25 +0000
commit1b0929a9f04d94d40962cf49a682f1e3f8f800fd (patch)
treec959248f6820bc4946b8eea8b2173e72478652bc /src/autoreplace_gui.cpp
parent4d2107bd618ea56e5ee0ac1e7db1aa0b88b6551d (diff)
downloadopenttd-1b0929a9f04d94d40962cf49a682f1e3f8f800fd.tar.xz
(svn r26640) -Cleanup: Remove some pointless STR_JUST_STRING detours.
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index c53df993f..e6ce64cfa 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -278,10 +278,8 @@ public:
}
case WID_RV_INFO_TAB: {
- SetDParam(0, STR_REPLACE_NOT_REPLACING);
- Dimension d = GetStringBoundingBox(STR_BLACK_STRING);
- SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
- d = maxdim(d, GetStringBoundingBox(STR_BLACK_STRING));
+ Dimension d = GetStringBoundingBox(STR_REPLACE_NOT_REPLACING);
+ d = maxdim(d, GetStringBoundingBox(STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED));
d.width += WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT;
d.height += WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
*size = maxdim(*size, d);
@@ -353,20 +351,21 @@ public:
switch (widget) {
case WID_RV_INFO_TAB: {
const Company *c = Company::Get(_local_company);
+ StringID str;
if (this->sel_engine[0] != INVALID_ENGINE) {
if (!EngineHasReplacementForCompany(c, this->sel_engine[0], this->sel_group)) {
- SetDParam(0, STR_REPLACE_NOT_REPLACING);
+ str = STR_REPLACE_NOT_REPLACING;
} else {
bool when_old = false;
EngineID e = EngineReplacementForCompany(c, this->sel_engine[0], this->sel_group, &when_old);
- SetDParam(0, when_old ? STR_REPLACE_REPLACING_WHEN_OLD : STR_ENGINE_NAME);
- SetDParam(1, e);
+ str = when_old ? STR_REPLACE_REPLACING_WHEN_OLD : STR_ENGINE_NAME;
+ SetDParam(0, e);
}
} else {
- SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
+ str = STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED;
}
- DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_HOR_CENTER);
+ DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_BLACK, SA_HOR_CENTER);
break;
}