(svn r22984) -Feature: Display profit icons for groups in the group GUI.

This commit is contained in:
frosch
2011-10-03 17:25:44 +00:00
parent d6e6e8a9d4
commit 23a2f23eb3
7 changed files with 110 additions and 23 deletions

View File

@@ -1137,7 +1137,10 @@ bool Vehicle::HandleBreakdown()
*/
void AgeVehicle(Vehicle *v)
{
if (v->age < MAX_DAY) v->age++;
if (v->age < MAX_DAY) {
v->age++;
if (v->IsPrimaryVehicle() && v->age == VEHICLE_PROFIT_MIN_AGE + 1) GroupStatistics::VehicleReachedProfitAge(v);
}
if (!v->IsPrimaryVehicle() && (v->type != VEH_TRAIN || !Train::From(v)->IsEngine())) return;
@@ -2402,6 +2405,11 @@ void VehiclesYearlyLoop()
SetWindowDirty(WC_VEHICLE_DETAILS, v->index);
}
}
GroupStatistics::UpdateProfits();
SetWindowClassesDirty(WC_TRAINS_LIST);
SetWindowClassesDirty(WC_SHIPS_LIST);
SetWindowClassesDirty(WC_ROADVEH_LIST);
SetWindowClassesDirty(WC_AIRCRAFT_LIST);
}