173 case VEH_TRAIN: |
173 case VEH_TRAIN: |
174 DrawTrainImage(v, x + 21, sprite_y, w->hscroll.cap + 4, w->hscroll.pos, WP(w,depot_d).sel); |
174 DrawTrainImage(v, x + 21, sprite_y, w->hscroll.cap + 4, w->hscroll.pos, WP(w,depot_d).sel); |
175 |
175 |
176 /* Number of wagons relative to a standard length wagon (rounded up) */ |
176 /* Number of wagons relative to a standard length wagon (rounded up) */ |
177 SetDParam(0, (v->u.rail.cached_total_length + 7) / 8); |
177 SetDParam(0, (v->u.rail.cached_total_length + 7) / 8); |
178 DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter |
178 DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, TC_FROMSTRING); // Draw the counter |
179 break; |
179 break; |
180 |
180 |
181 case VEH_ROAD: DrawRoadVehImage( v, x + 24, sprite_y, 1, WP(w, depot_d).sel); break; |
181 case VEH_ROAD: DrawRoadVehImage( v, x + 24, sprite_y, 1, WP(w, depot_d).sel); break; |
182 case VEH_SHIP: DrawShipImage( v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break; |
182 case VEH_SHIP: DrawShipImage( v, x + 19, sprite_y - 1, WP(w, depot_d).sel); break; |
183 case VEH_AIRCRAFT: { |
183 case VEH_AIRCRAFT: { |
198 } |
198 } |
199 |
199 |
200 DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, x + diff_x, y + diff_y); |
200 DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, x + diff_x, y + diff_y); |
201 |
201 |
202 SetDParam(0, v->unitnumber); |
202 SetDParam(0, v->unitnumber); |
203 DrawString(x, y + 2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0); |
203 DrawString(x, y + 2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, TC_FROMSTRING); |
204 } |
204 } |
205 |
205 |
206 static void DrawDepotWindow(Window *w) |
206 static void DrawDepotWindow(Window *w) |
207 { |
207 { |
208 Vehicle **vl = WP(w, depot_d).vehicle_list; |
208 Vehicle **vl = WP(w, depot_d).vehicle_list; |
272 for (; num < maxval; num++, y += 14) { |
272 for (; num < maxval; num++, y += 14) { |
273 const Vehicle *v = WP(w, depot_d).wagon_list[num - WP(w, depot_d).engine_count]; |
273 const Vehicle *v = WP(w, depot_d).wagon_list[num - WP(w, depot_d).engine_count]; |
274 const Vehicle *u; |
274 const Vehicle *u; |
275 |
275 |
276 DrawTrainImage(v, x + 50, y, w->hscroll.cap - 29, 0, WP(w,depot_d).sel); |
276 DrawTrainImage(v, x + 50, y, w->hscroll.cap - 29, 0, WP(w,depot_d).sel); |
277 DrawString(x, y + 2, STR_8816, 0); |
277 DrawString(x, y + 2, STR_8816, TC_FROMSTRING); |
278 |
278 |
279 /*Draw the train counter */ |
279 /*Draw the train counter */ |
280 i = 0; |
280 i = 0; |
281 u = v; |
281 u = v; |
282 do i++; while ((u = u->Next()) != NULL); // Determine length of train |
282 do i++; while ((u = u->Next()) != NULL); // Determine length of train |
283 SetDParam(0, i); // Set the counter |
283 SetDParam(0, i); // Set the counter |
284 DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter |
284 DrawStringRightAligned(w->widget[DEPOT_WIDGET_MATRIX].right - 1, y + 4, STR_TINY_BLACK, TC_FROMSTRING); // Draw the counter |
285 } |
285 } |
286 } |
286 } |
287 |
287 |
288 struct GetDepotVehiclePtData { |
288 struct GetDepotVehiclePtData { |
289 Vehicle *head; |
289 Vehicle *head; |