mirror of https://github.com/OpenTTD/OpenTTD.git
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
This commit is contained in:
parent
928276a66e
commit
5f1154e076
|
@ -2800,6 +2800,7 @@ public:
|
|||
|
||||
const Vehicle *v = Vehicle::Get(this->window_number);
|
||||
StringID str;
|
||||
TextColour text_colour = TC_FROMSTRING;
|
||||
if (v->vehstatus & VS_CRASHED) {
|
||||
str = STR_VEHICLE_STATUS_CRASHED;
|
||||
} else if (v->type != VEH_AIRCRAFT && v->breakdown_ctr == 1) { // check for aircraft necessary?
|
||||
|
@ -2824,6 +2825,13 @@ public:
|
|||
} else if (v->type == VEH_AIRCRAFT && HasBit(Aircraft::From(v)->flags, VAF_DEST_TOO_FAR) && !v->current_order.IsType(OT_LOADING)) {
|
||||
str = STR_VEHICLE_STATUS_AIRCRAFT_TOO_FAR;
|
||||
} else { // vehicle is in a "normal" state, show current order
|
||||
if (mouse_over_start_stop) {
|
||||
if (v->vehstatus & VS_STOPPED) {
|
||||
text_colour = TC_RED | TC_FORCED;
|
||||
} else if (v->type == VEH_TRAIN && HasBit(Train::From(v)->flags, VRF_TRAIN_STUCK) && !v->current_order.IsType(OT_LOADING)) {
|
||||
text_colour = TC_ORANGE | TC_FORCED;
|
||||
}
|
||||
}
|
||||
switch (v->current_order.GetType()) {
|
||||
case OT_GOTO_STATION: {
|
||||
SetDParam(0, v->current_order.GetDestination());
|
||||
|
@ -2890,7 +2898,7 @@ public:
|
|||
int image = ((v->vehstatus & VS_STOPPED) != 0) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING;
|
||||
int lowered = this->IsWidgetLowered(WID_VV_START_STOP) ? 1 : 0;
|
||||
DrawSprite(image, PAL_NONE, image_left + lowered, r.top + WD_IMGBTN_TOP + lowered);
|
||||
DrawString(text_left + lowered, text_right + lowered, r.top + WD_FRAMERECT_TOP + lowered, str, TC_FROMSTRING, SA_HOR_CENTER);
|
||||
DrawString(text_left + lowered, text_right + lowered, r.top + WD_FRAMERECT_TOP + lowered, str, text_colour, SA_HOR_CENTER);
|
||||
}
|
||||
|
||||
void OnClick(Point pt, int widget, int click_count) override
|
||||
|
|
Loading…
Reference in New Issue