Rename close window functions to match upstream

This commit is contained in:
Jonathan G Rennison
2023-09-15 20:59:08 +01:00
parent ed1b842ad3
commit a18f3274b4
75 changed files with 291 additions and 299 deletions

View File

@@ -1456,7 +1456,7 @@ static WindowDesc _vehicle_refit_desc(
*/
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent, bool auto_refit, bool is_virtual_train)
{
DeleteWindowById(WC_VEHICLE_REFIT, v->index);
CloseWindowById(WC_VEHICLE_REFIT, v->index);
RefitWindow *w = new RefitWindow(&_vehicle_refit_desc, v, order, auto_refit, is_virtual_train);
w->parent = parent;
}
@@ -3431,8 +3431,8 @@ static WindowDesc _nontrain_vehicle_details_desc(
/** Shows the vehicle details window of the given vehicle. */
static void ShowVehicleDetailsWindow(const Vehicle *v)
{
DeleteWindowById(WC_VEHICLE_ORDERS, v->index, false);
DeleteWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
CloseWindowById(WC_VEHICLE_ORDERS, v->index, false);
CloseWindowById(WC_VEHICLE_TIMETABLE, v->index, false);
AllocateWindowDescFront<VehicleDetailsWindow>((v->type == VEH_TRAIN) ? &_train_vehicle_details_desc : &_nontrain_vehicle_details_desc, v->index);
}
@@ -3682,10 +3682,10 @@ public:
const Vehicle *v = Vehicle::Get(this->window_number);
MarkDirtyFocusedRoutePaths(v);
}
DeleteWindowById(WC_VEHICLE_ORDERS, this->window_number, false);
DeleteWindowById(WC_VEHICLE_REFIT, this->window_number, false);
DeleteWindowById(WC_VEHICLE_DETAILS, this->window_number, false);
DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false);
CloseWindowById(WC_VEHICLE_ORDERS, this->window_number, false);
CloseWindowById(WC_VEHICLE_REFIT, this->window_number, false);
CloseWindowById(WC_VEHICLE_DETAILS, this->window_number, false);
CloseWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false);
if (this->fixed_route_overlay_active) {
RemoveFixedViewportRoutePath(this->window_number);