summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-07-13 19:34:43 +0000
committerfrosch <frosch@openttd.org>2009-07-13 19:34:43 +0000
commitdb69c343f1c64601ad594bbf0e41b463b9d3a434 (patch)
tree62396765dae26a043cf2c11139f0b8201d482a47 /src
parent3973b1e7cb5d244374e517879ec9f9017c95446f (diff)
downloadopenttd-db69c343f1c64601ad594bbf0e41b463b9d3a434.tar.xz
(svn r16818) -Feature(ette): Highlight whole articulated vehicles in traindepot instead of only the first part.
Diffstat (limited to 'src')
-rw-r--r--src/train_gui.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 9ccf03eb0..6c5724af3 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -86,6 +86,7 @@ void DrawTrainImage(const Train *v, int x, int y, VehicleID selection, int max_w
_cur_dpi = &tmp_dpi;
int px = -skip;
+ bool sel_articulated = false;
for (; v != NULL && px < max_width; v = v->Next()) {
int width = WagonLengthToPixels(Train::From(v)->tcache.cached_veh_length);
@@ -94,11 +95,14 @@ void DrawTrainImage(const Train *v, int x, int y, VehicleID selection, int max_w
DrawSprite(v->GetImage(DIR_W), pal, px + 16, 7 + (is_custom_sprite(RailVehInfo(v->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0));
}
+ if (!v->IsArticulatedPart()) sel_articulated = false;
+
if (v->index == selection) {
/* Set the highlight position */
highlight_l = px + 1;
highlight_r = px + width + 1;
- } else if (_cursor.vehchain && highlight_r != 0) {
+ sel_articulated = true;
+ } else if ((_cursor.vehchain && highlight_r != 0) || sel_articulated) {
highlight_r += width;
}