Changeset - r12378:e294ac78ad96
[Not reviewed]
master
0 1 0
frosch - 15 years ago 2009-07-13 19:34:43
frosch@openttd.org
(svn r16818) -Feature(ette): Highlight whole articulated vehicles in traindepot instead of only the first part.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/train_gui.cpp
Show inline comments
 
@@ -86,6 +86,7 @@ void DrawTrainImage(const Train *v, int 
 
	_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 
 
			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;
 
		}
 

	
0 comments (0 inline, 0 general)