Refresh trace restrict slots window as with the train list window

This commit is contained in:
Jonathan G Rennison
2018-08-15 19:38:56 +01:00
parent acdeaa715e
commit 60cc1a48ac
6 changed files with 14 additions and 0 deletions

View File

@@ -1353,6 +1353,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
/* We are undoubtedly changing something in the depot and train list. */
InvalidateWindowData(WC_VEHICLE_DEPOT, src->tile);
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
InvalidateWindowClassesData(WC_TRACE_RESTRICT_SLOTS, 0);
} else {
/* We don't want to execute what we're just tried. */
RestoreTrainBackup(original_src);
@@ -1437,6 +1438,7 @@ CommandCost CmdSellRailWagon(DoCommandFlag flags, Vehicle *t, uint16 data, uint3
/* We are undoubtedly changing something in the depot and train list. */
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
InvalidateWindowClassesData(WC_TRACE_RESTRICT_SLOTS, 0);
/* Actually delete the sold 'goods' */
delete sell_head;
@@ -1951,6 +1953,7 @@ CommandCost CmdReverseTrainDirection(TileIndex tile, DoCommandFlag flags, uint32
SetWindowDirty(WC_VEHICLE_DETAILS, front->index);
SetWindowDirty(WC_VEHICLE_VIEW, front->index);
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
}
} else {
/* turn the whole train around */
@@ -2164,6 +2167,7 @@ static bool CheckTrainStayInDepot(Train *v)
/* force proceed was not pressed */
if (++v->wait_counter < 37) {
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
return true;
}
@@ -2173,6 +2177,7 @@ static bool CheckTrainStayInDepot(Train *v)
if (seg_state == SIGSEG_FULL || HasDepotReservation(v->tile)) {
/* Full and no PBS signal in block or depot reserved, can't exit. */
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
return true;
}
} else {
@@ -2192,6 +2197,7 @@ static bool CheckTrainStayInDepot(Train *v)
if (seg_state == SIGSEG_PBS && !TryPathReserve(v) && v->force_proceed == TFP_NONE) {
/* No path and no force proceed. */
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
MarkTrainAsStuck(v);
return true;
}
@@ -2201,6 +2207,7 @@ static bool CheckTrainStayInDepot(Train *v)
VehicleServiceInDepot(v);
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
v->PlayLeaveStationSound();
v->track = TRACK_BIT_X;
@@ -4172,6 +4179,7 @@ void Train::OnNewDay()
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_TRACE_RESTRICT_SLOTS);
}
}
}