diff options
author | rubidium <rubidium@openttd.org> | 2011-12-16 16:58:55 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-12-16 16:58:55 +0000 |
commit | 4de1f3be885730cfa7dad6c6b3a4608f8808ce37 (patch) | |
tree | 62f55b8ed6b4d1fa65f5a4cb7c868ad97f5ffe62 /src/train_cmd.cpp | |
parent | b8640b986f2a7188b7a21d4093a211b21a926c3e (diff) | |
download | openttd-4de1f3be885730cfa7dad6c6b3a4608f8808ce37.tar.xz |
(svn r23540) -Codechange: unify and document vehicle widgets
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 8af59b741..f5a07f20e 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1101,7 +1101,7 @@ static void NormaliseTrainHead(Train *head) /* Update the refit button and window */ InvalidateWindowData(WC_VEHICLE_REFIT, head->index); - SetWindowWidgetDirty(WC_VEHICLE_VIEW, head->index, VVW_WIDGET_REFIT_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, head->index, WID_VV_REFIT); /* If we don't have a unit number yet, set one. */ if (head->unitnumber != 0) return; @@ -1458,7 +1458,7 @@ static void MarkTrainAsStuck(Train *v) v->subspeed = 0; v->SetLastSpeed(); - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } } @@ -1787,7 +1787,7 @@ void ReverseTrainDirection(Train *v) /* If we are inside a depot after reversing, don't bother with path reserving. */ if (v->track == TRACK_BIT_DEPOT) { /* Can't be stuck here as inside a depot is always a safe tile. */ - if (HasBit(v->flags, VRF_TRAIN_STUCK)) SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + if (HasBit(v->flags, VRF_TRAIN_STUCK)) SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); ClrBit(v->flags, VRF_TRAIN_STUCK); return; } @@ -2595,7 +2595,7 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay) /* If we have a reserved path and the path ends at a safe tile, we are finished already. */ if (origin.okay && (v->tile != origin.tile || first_tile_okay)) { /* Can't be stuck then. */ - if (HasBit(v->flags, VRF_TRAIN_STUCK)) SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + if (HasBit(v->flags, VRF_TRAIN_STUCK)) SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); ClrBit(v->flags, VRF_TRAIN_STUCK); return true; } @@ -2623,7 +2623,7 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay) if (HasBit(v->flags, VRF_TRAIN_STUCK)) { v->wait_counter = 0; - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } ClrBit(v->flags, VRF_TRAIN_STUCK); return true; @@ -3607,7 +3607,7 @@ static bool TrainLocoHandler(Train *v, bool mode) if (v->force_proceed != TFP_NONE) { ClrBit(v->flags, VRF_TRAIN_STUCK); - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } /* train is broken down? */ @@ -3682,13 +3682,13 @@ static bool TrainLocoHandler(Train *v, bool mode) if (v->force_proceed == TFP_NONE) return true; ClrBit(v->flags, VRF_TRAIN_STUCK); v->wait_counter = 0; - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } } if (v->current_order.IsType(OT_LEAVESTATION)) { v->current_order.Free(); - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); return true; } @@ -3812,7 +3812,7 @@ static void CheckIfTrainNeedsService(Train *v) * suddenly moved farther away, we continue our normal * schedule? */ v->current_order.MakeDummy(); - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } return; } @@ -3828,7 +3828,7 @@ static void CheckIfTrainNeedsService(Train *v) SetBit(v->gv_flags, GVF_SUPPRESS_IMPLICIT_ORDERS); v->current_order.MakeGoToDepot(depot, ODTFB_SERVICE); v->dest_tile = tfdd.tile; - SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH); + SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); } void Train::OnNewDay() |