1
0
Fork 0

(svn r1652) Fix: train and road vehicle lists are now redrawn when vehicles enters/leaves a depot (Hackykid)

fix: the ship status bar was not updated properly after a breakdown if show_speed was off (Hackykid)
release/0.4.5
bjarni 2005-01-24 22:24:47 +00:00
parent ffb2c4de77
commit e006f89aa3
6 changed files with 23 additions and 15 deletions

View File

@ -1408,6 +1408,7 @@ void RoadVehEnterDepot(Vehicle *v)
}
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClasses(WC_ROADVEH_LIST);
}
static void AgeRoadVehCargo(Vehicle *v)
@ -1504,7 +1505,7 @@ void OnNewDay_RoadVeh(Vehicle *v)
SubtractMoneyFromPlayerFract(v->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
InvalidateWindow(WC_ROADVEH_LIST, v->owner);
InvalidateWindowClasses(WC_ROADVEH_LIST);
}
void HandleClickOnRoadVeh(Vehicle *v)

View File

@ -822,7 +822,7 @@ static void PlayerRoadVehWndProc(Window *w, WindowEvent *e)
DrawVehicleProfitButton(v, x, y + 13);
SetDParam(0, v->unitnumber);
if (IsRoadDepotTile(v->tile))
if (IsRoadDepotTile(v->tile) && (v->vehstatus & VS_HIDDEN))
str = STR_021F;
else
str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2;

View File

@ -175,7 +175,7 @@ static void HandleBrokenShip(Vehicle *v)
if (!(v->tick_counter & 1)) {
if (!--v->breakdown_delay) {
v->breakdown_ctr = 0;
InvalidateWindowClasses(WC_SHIPS_LIST);
InvalidateWindow(WC_VEHICLE_VIEW, v->index);
}
}
}

View File

@ -1336,15 +1336,21 @@ static bool CheckTrainStayInDepot(Vehicle *v)
return false;
if (v->u.rail.force_proceed == 0) {
if (++v->load_unload_time_rem < 37)
return true;
v->load_unload_time_rem = 0;
if (UpdateSignalsOnSegment(v->tile, v->direction))
if (++v->load_unload_time_rem < 37) {
InvalidateWindowClasses(WC_TRAINS_LIST);
return true;
}
v->load_unload_time_rem = 0;
if (UpdateSignalsOnSegment(v->tile, v->direction)) {
InvalidateWindowClasses(WC_TRAINS_LIST);
return true;
}
}
VehicleServiceInDepot(v);
InvalidateWindowClasses(WC_TRAINS_LIST);
TrainPlayLeaveStationSound(v);
v->u.rail.track = 1;
@ -2690,6 +2696,7 @@ void TrainEnterDepot(Vehicle *v, uint tile)
}
}
}
InvalidateWindowClasses(WC_TRAINS_LIST);
}
static void CheckIfTrainNeedsService(Vehicle *v)
@ -2797,7 +2804,7 @@ void OnNewDay_Train(Vehicle *v)
SubtractMoneyFromPlayerFract(v->owner, cost);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
InvalidateWindow(WC_TRAINS_LIST, v->owner);
InvalidateWindowClasses(WC_TRAINS_LIST);
}
}
}

View File

@ -1319,7 +1319,7 @@ static void PlayerTrainsWndProc(Window *w, WindowEvent *e)
DrawVehicleProfitButton(v, x, y + 13);
SetDParam(0, v->unitnumber);
if (IsTrainDepotTile(v->tile))
if (IsTrainDepotTile(v->tile) && (v->vehstatus & VS_HIDDEN))
str = STR_021F;
else
str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2;