Changeset - r7312:7037b4794eab
[Not reviewed]
master
0 2 0
truelight - 17 years ago 2007-07-23 19:24:32
truelight@openttd.org
(svn r10664) -Codechange: simplify a small piece of code (skidd13)
2 files changed with 17 insertions and 20 deletions:
0 comments (0 inline, 0 general)
src/order_gui.cpp
Show inline comments
 
@@ -115,7 +115,6 @@ static void DrawOrdersWindow(Window *w)
 
	int sel;
 
	int y, i;
 
	bool shared_orders;
 
	byte color;
 

	
 
	v = GetVehicle(w->window_number);
 

	
 
@@ -192,6 +191,11 @@ static void DrawOrdersWindow(Window *w)
 
			SetDParam(1, 6);
 

	
 
			switch (order->type) {
 
				case OT_DUMMY:
 
					SetDParam(1, STR_INVALID_ORDER);
 
					SetDParam(2, order->dest);
 
					break;
 

	
 
				case OT_GOTO_STATION:
 
					SetDParam(1, StationOrderStrings[order->flags]);
 
					SetDParam(2, order->dest);
 
@@ -234,15 +238,10 @@ static void DrawOrdersWindow(Window *w)
 
				default: break;
 
			}
 

	
 
			color = (i == WP(w,order_d).sel) ? 0xC : 0x10;
 
			const byte colour = (i == WP(w,order_d).sel) ? 0xC : 0x10;
 
			SetDParam(0, i + 1);
 
			if (order->type != OT_DUMMY) {
 
				DrawString(2, y, str, color);
 
			} else {
 
				SetDParam(1, STR_INVALID_ORDER);
 
				SetDParam(2, order->dest);
 
				DrawString(2, y, str, color);
 
			}
 
			DrawString(2, y, str, colour);
 

	
 
			y += 10;
 
		}
 

	
 
@@ -252,8 +251,8 @@ static void DrawOrdersWindow(Window *w)
 

	
 
	if (i - w->vscroll.pos < w->vscroll.cap) {
 
		str = shared_orders ? STR_END_OF_SHARED_ORDERS : STR_882A_END_OF_ORDERS;
 
		color = (i == WP(w,order_d).sel) ? 0xC : 0x10;
 
		DrawString(2, y, str, color);
 
		const byte colour = (i == WP(w,order_d).sel) ? 0xC : 0x10;
 
		DrawString(2, y, str, colour);
 
	}
 
}
 

	
src/timetable_gui.cpp
Show inline comments
 
@@ -96,6 +96,10 @@ static void DrawTimetableWindow(Window *
 
			SetDParam(2, STR_EMPTY);
 

	
 
			switch (order->type) {
 
				case OT_DUMMY:
 
					SetDParam(0, STR_INVALID_ORDER);
 
					break;
 

	
 
				case OT_GOTO_STATION:
 
					SetDParam(0, (order->flags & OF_NON_STOP) ? STR_880C_GO_NON_STOP_TO : STR_8806_GO_TO);
 
					SetDParam(1, order->dest);
 
@@ -137,14 +141,8 @@ static void DrawTimetableWindow(Window *
 
				default: break;
 
			}
 

	
 
			byte colour = (i == selected) ? 0xC : 0x10;
 

	
 
			if (order->type != OT_DUMMY) {
 
				DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
 
			} else {
 
				SetDParam(0, STR_INVALID_ORDER);
 
				DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
 
			}
 
			const byte colour = (i == selected) ? 0xC : 0x10;
 
			DrawString(2, y, STR_TIMETABLE_GO_TO, colour);
 

	
 
			order_id++;
 

	
 
@@ -164,7 +162,7 @@ static void DrawTimetableWindow(Window *
 
				string = STR_TIMETABLE_TRAVEL_FOR;
 
			}
 

	
 
			byte colour = (i == selected) ? 0xC : 0x10;
 
			const byte colour = (i == selected) ? 0xC : 0x10;
 
			DrawString(12, y, string, colour);
 

	
 
			if (final_order) break;
0 comments (0 inline, 0 general)