summaryrefslogtreecommitdiff
path: root/src/town_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-30 16:29:52 +0000
committerfrosch <frosch@openttd.org>2010-01-30 16:29:52 +0000
commitaf50e0a4cfd1d6c16801d798705482c92ae93844 (patch)
tree14cc5eb40a08fbe89ab523c6daa3535d5fdafc6b /src/town_gui.cpp
parent272f2cd93e2e979d742bc48e24d5d2ed7066a98d (diff)
downloadopenttd-af50e0a4cfd1d6c16801d798705482c92ae93844.tar.xz
(svn r18964) -Change: Highlight the selected action for town authority, and do not duplicate the itemtext to the description.
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r--src/town_gui.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 3c3cd6cfe..d70872b04 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -187,8 +187,7 @@ public:
switch (widget) {
case TWA_ACTION_INFO:
if (this->sel_index != -1) {
- SetDParam(1, _price[PR_TOWN_ACTION] * _town_action_costs[this->sel_index] >> 8);
- SetDParam(0, STR_LOCAL_AUTHORITY_ACTION_SMALL_ADVERTISING_CAMPAIGN + this->sel_index);
+ SetDParam(0, _price[PR_TOWN_ACTION] * _town_action_costs[this->sel_index] >> 8);
DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom - WD_FRAMERECT_BOTTOM,
STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING + this->sel_index);
}
@@ -208,7 +207,8 @@ public:
if (pos <= -5) break; ///< Draw only the 5 fitting lines
if ((buttons & 1) && --pos < 0) {
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_LOCAL_AUTHORITY_ACTION_SMALL_ADVERTISING_CAMPAIGN + i, TC_ORANGE);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y,
+ STR_LOCAL_AUTHORITY_ACTION_SMALL_ADVERTISING_CAMPAIGN + i, this->sel_index == i ? TC_WHITE : TC_ORANGE);
y += FONT_HEIGHT_NORMAL;
}
}
@@ -226,8 +226,7 @@ public:
size->height -= WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
Dimension d = {0, 0};
for (int i = 0; i < TACT_COUNT; i++) {
- SetDParam(1, _price[PR_TOWN_ACTION] * _town_action_costs[i] >> 8);
- SetDParam(0, STR_LOCAL_AUTHORITY_ACTION_SMALL_ADVERTISING_CAMPAIGN + i);
+ SetDParam(0, _price[PR_TOWN_ACTION] * _town_action_costs[i] >> 8);
d = maxdim(d, GetStringMultiLineBoundingBox(STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_SMALL_ADVERTISING + i, *size));
}
*size = maxdim(*size, d);