(svn r24260) -Change [FS#5126]: Make the oilrig-vehicle list accessible to specators and colour it's caption neutrally grey.

This commit is contained in:
frosch
2012-05-16 22:08:46 +00:00
parent c94a2d5289
commit db09f67674
3 changed files with 12 additions and 18 deletions

View File

@@ -1358,7 +1358,7 @@ public:
}
this->FinishInitNested(desc, window_number);
this->owner = this->vli.company;
if (this->vli.company != OWNER_NONE) this->owner = this->vli.company;
if (this->vli.vtype == VEH_TRAIN) ResizeWindow(this, 65, 0);
}
@@ -1609,7 +1609,7 @@ static WindowDesc _vehicle_list_desc(
static void ShowVehicleListWindowLocal(CompanyID company, VehicleListType vlt, VehicleType vehicle_type, uint16 unique_number)
{
if (!Company::IsValidID(company)) return;
if (!Company::IsValidID(company) && company != OWNER_NONE) return;
_vehicle_list_desc.cls = GetWindowClassForVehicleType(vehicle_type);
AllocateWindowDescFront<VehicleListWindow>(&_vehicle_list_desc, VehicleListIdentifier(vlt, vehicle_type, company, unique_number).Pack());
@@ -1636,15 +1636,7 @@ void ShowVehicleListWindow(const Vehicle *v)
void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type, StationID station)
{
if (!Company::IsValidID(company)) {
company = _local_company;
/* This can happen when opening the vehicle list as a spectator. */
if (!Company::IsValidID(company)) return;
_vehicle_list_desc.flags |= WDF_CONSTRUCTION;
} else {
_vehicle_list_desc.flags &= ~WDF_CONSTRUCTION;
}
_vehicle_list_desc.flags &= ~WDF_CONSTRUCTION;
ShowVehicleListWindowLocal(company, VL_STATION_LIST, vehicle_type, station);
}