mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-19 02:12:37 +01:00
Codechange: ToWindowNumber describes better what is the intent than Pack
This commit is contained in:
@@ -363,7 +363,7 @@ std::tuple<CommandCost, GroupID> CmdCreateGroup(DoCommandFlag flags, VehicleType
|
||||
g->flags = pg->flags;
|
||||
}
|
||||
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).ToWindowNumber());
|
||||
InvalidateWindowData(WC_COMPANY_COLOUR, g->owner, g->vehicle_type);
|
||||
|
||||
return { CommandCost(), g->index };
|
||||
@@ -415,7 +415,7 @@ CommandCost CmdDeleteGroup(DoCommandFlag flags, GroupID group_id)
|
||||
CloseWindowById(WC_REPLACE_VEHICLE, g->vehicle_type);
|
||||
delete g;
|
||||
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vt), VehicleListIdentifier(VL_GROUP_LIST, vt, _current_company).ToWindowNumber());
|
||||
InvalidateWindowData(WC_COMPANY_COLOUR, _current_company, vt);
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ CommandCost CmdAlterGroup(DoCommandFlag flags, AlterGroupMode mode, GroupID grou
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
InvalidateWindowData(WC_REPLACE_VEHICLE, g->vehicle_type, 1);
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).ToWindowNumber());
|
||||
InvalidateWindowData(WC_COMPANY_COLOUR, g->owner, g->vehicle_type);
|
||||
InvalidateWindowClassesData(WC_VEHICLE_VIEW);
|
||||
InvalidateWindowClassesData(WC_VEHICLE_DETAILS);
|
||||
@@ -590,7 +590,7 @@ std::tuple<CommandCost, GroupID> CmdAddVehicleGroup(DoCommandFlag flags, GroupID
|
||||
|
||||
/* Update the Replace Vehicle Windows */
|
||||
SetWindowDirty(WC_REPLACE_VEHICLE, vtype);
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vtype), VehicleListIdentifier(VL_GROUP_LIST, vtype, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(vtype), VehicleListIdentifier(VL_GROUP_LIST, vtype, _current_company).ToWindowNumber());
|
||||
}
|
||||
|
||||
return { CommandCost(), new_g };
|
||||
@@ -621,7 +621,7 @@ CommandCost CmdAddSharedVehicleGroup(DoCommandFlag flags, GroupID id_g, VehicleT
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(type), VehicleListIdentifier(VL_GROUP_LIST, type, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(type), VehicleListIdentifier(VL_GROUP_LIST, type, _current_company).ToWindowNumber());
|
||||
}
|
||||
|
||||
return CommandCost();
|
||||
@@ -651,7 +651,7 @@ CommandCost CmdRemoveAllVehiclesGroup(DoCommandFlag flags, GroupID group_id)
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack());
|
||||
InvalidateWindowData(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).ToWindowNumber());
|
||||
}
|
||||
|
||||
return CommandCost();
|
||||
@@ -729,7 +729,7 @@ CommandCost CmdSetGroupFlag(DoCommandFlag flags, GroupID group_id, GroupFlag fla
|
||||
if (flags & DC_EXEC) {
|
||||
SetGroupFlag(g, flag, value, recursive);
|
||||
|
||||
SetWindowDirty(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).Pack());
|
||||
SetWindowDirty(GetWindowClassForVehicleType(g->vehicle_type), VehicleListIdentifier(VL_GROUP_LIST, g->vehicle_type, _current_company).ToWindowNumber());
|
||||
InvalidateWindowData(WC_REPLACE_VEHICLE, g->vehicle_type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user