summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-15 10:02:39 +0000
committerrubidium <rubidium@openttd.org>2008-09-15 10:02:39 +0000
commit1ce4e5721bb14c476dc16b76ffb0a8b168c24722 (patch)
tree18806ff381c0cb5be7efefa5f7967d924023b1dc /src/vehicle_gui.cpp
parent6be25eabb36b2d004554ef60f007cad909cb50d8 (diff)
downloadopenttd-1ce4e5721bb14c476dc16b76ffb0a8b168c24722.tar.xz
(svn r14329) -Fix (r14306): selections in the group GUI weren't shown anymore.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 616fb1eb9..dd78497bb 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -741,8 +741,9 @@ static void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection
/**
* Draw all the vehicle list items.
* @param x the position from where to draw the items.
+ * @param selected_vehicle the vehicle that is to be selected
*/
-void BaseVehicleListWindow::DrawVehicleListItems(int x)
+void BaseVehicleListWindow::DrawVehicleListItems(int x, VehicleID selected_vehicle)
{
int y = PLY_WND_PRC__OFFSET_TOP_WIDGET;
uint max = min(this->vscroll.pos + this->vscroll.cap, this->vehicles.Length());
@@ -753,7 +754,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(int x)
SetDParam(0, v->GetDisplayProfitThisYear());
SetDParam(1, v->GetDisplayProfitLastYear());
- DrawVehicleImage(v, x + 19, y + 6, INVALID_VEHICLE, this->widget[VLW_WIDGET_LIST].right - this->widget[VLW_WIDGET_LIST].left - 20, 0);
+ DrawVehicleImage(v, x + 19, y + 6, selected_vehicle, this->widget[VLW_WIDGET_LIST].right - this->widget[VLW_WIDGET_LIST].left - 20, 0);
DrawString(x + 19, y + this->resize.step_height - 8, STR_0198_PROFIT_THIS_YEAR_LAST_YEAR, TC_FROMSTRING);
if (v->name != NULL) {
@@ -992,7 +993,7 @@ struct VehicleListWindow : public BaseVehicleListWindow {
/* draw arrow pointing up/down for ascending/descending sorting */
this->DrawSortButtonState(VLW_WIDGET_SORT_ORDER, this->vehicles.IsDescSortOrder() ? SBS_DOWN : SBS_UP);
- this->DrawVehicleListItems(x);
+ this->DrawVehicleListItems(x, INVALID_VEHICLE);
}
virtual void OnClick(Point pt, int widget)