public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(DepotAI), "CreateVehicle",
                                        BindingFlags.Instance | BindingFlags.NonPublic),
         new PatchUtil.MethodDefinition(typeof(CreateVehiclePatch), nameof(Prefix)));
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(TransportLineAI), "AddLaneConnection"),
         new PatchUtil.MethodDefinition(typeof(AddLaneConnectionPatch), nameof(Prefix))
         );
 }
示例#3
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(PanelExtenderCityService), "OnSelectedPrefabsChanged"),
         null, null,
         new PatchUtil.MethodDefinition(typeof(PanelExtenderCityServicePatch), nameof(Transpile)));
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(PathFind), "ProcessItem",
                                        argumentTypes: FindProcessItemMethodArgTypes()),
         null, null,
         new PatchUtil.MethodDefinition(typeof(ProcessItemPatch), (nameof(Transpile))));
 }
示例#5
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(DepotAI), nameof(DepotAI.StartTransfer)),
         new PatchUtil.MethodDefinition(typeof(DepotAIPatch), nameof(StartTransferPre)),
         null
         );
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(FerryAI), nameof(FerryAI.SimulationStep),
                                        argumentTypes: new Type[] { typeof(ushort), typeof(Vehicle).MakeByRefType(), typeof(Vector3) }),
         null, null,
         new PatchUtil.MethodDefinition(typeof(SimulationStepPatch), (nameof(Transpile))));
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(VehicleManager), "ReleaseWaterSource"),
         null,
         new PatchUtil.MethodDefinition(typeof(VehicleManagerPatch), nameof(ReleaseWaterSourcePost))
         );
 }
示例#8
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(CargoTruckAI), nameof(CargoTruckAI.ChangeVehicleType),
                                        BindingFlags.Static | BindingFlags.Public),
         null, null,
         new PatchUtil.MethodDefinition(typeof(CargoTruckAIChangeVehicleTypePatch), (nameof(Transpile))));
 }
示例#9
0
 private static void PatchLoadPassengers(Type type)
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(type, LoadPassengersMethod),
         new PatchUtil.MethodDefinition(typeof(LoadPassengersPatch), nameof(LoadPassengersPre)),
         new PatchUtil.MethodDefinition(typeof(LoadPassengersPatch), nameof(LoadPassengersPost))
         );
 }
示例#10
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(NetManager), nameof(NetManager.ReleaseNode)),
         null,
         new PatchUtil.MethodDefinition(typeof(NetManagerPatch), nameof(ReleaseNodePost))
         );
 }
示例#11
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(ServiceBuildingVehicleSelector),
                                        "GetVehicleInfo"),
         new PatchUtil.MethodDefinition(typeof(GetVehicleInfoPatch),
                                        nameof(Prefix))
         );
 }
示例#12
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(TransportLine),
                                        nameof(TransportLine.GetLineVehicle)),
         new PatchUtil.MethodDefinition(typeof(TransportLineGetLineVehiclePatch),
                                        nameof(Prefix))
         );
 }
示例#13
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(TransportLine), nameof(TransportLine.SimulationStep)),
         new PatchUtil.MethodDefinition(typeof(TransportLineSimulationStepPatch), nameof(Prefix)),
         new PatchUtil.MethodDefinition(typeof(TransportLineSimulationStepPatch), nameof(Postfix)),
         new PatchUtil.MethodDefinition(typeof(TransportLineSimulationStepPatch), nameof(Transpile))
         );
 }
示例#14
0
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(PublicTransportLineVehicleModelSelector),
                                        nameof(PublicTransportLineVehicleModelSelector.Refresh)),
         new PatchUtil.MethodDefinition(typeof(PublicTransportLineVehicleModelSelectorRefreshPatch),
                                        nameof(Prefix))
         );
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(PlayerBuildingAI),
                                        nameof(PlayerBuildingAI.GetSelectedVehicle)),
         new PatchUtil.MethodDefinition(typeof(GetSelectedVehiclePatch),
                                        nameof(Prefix))
         );
 }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(NetSegment), nameof(NetSegment.GetClosestLanePosition),
                                        argumentTypes: new[] { typeof(Vector3), typeof(NetInfo.LaneType), typeof(VehicleInfo.VehicleType), typeof(VehicleInfo.VehicleType),
                                                               typeof(bool),
                                                               typeof(Vector3).MakeByRefType(), typeof(int).MakeByRefType(), typeof(float).MakeByRefType(), typeof(Vector3).MakeByRefType(), typeof(int).MakeByRefType(), typeof(float).MakeByRefType() }),
         new PatchUtil.MethodDefinition(typeof(GetClosestLanePositionPatch), nameof(Prefix))
         );
 }
 public static void Apply()
 {
     if (isApplied)
     {
         return;
     }
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(global::CargoTruckAI), nameof(global::CargoTruckAI.ChangeVehicleType),
                                        BindingFlags.Static | BindingFlags.Public),
         null, null,
         new PatchUtil.MethodDefinition(typeof(ChangeVehicleTypePatch), (nameof(Transpile))));
     isApplied = true;
 }
示例#18
0
        public static void Apply()
        {
            if (deployed)
            {
                return;
            }

            PatchUtil.Patch(
                new PatchUtil.MethodDefinition(typeof(VehicleInfo), nameof(VehicleInfo.InitializePrefab)),
                new PatchUtil.MethodDefinition(typeof(InitializePrefabPatch), nameof(PreInitializePrefab)));

            deployed = true;
        }
        public static void Deploy()
        {
            if (deployed)
            {
                return;
            }

            PatchUtil.Patch(
                new PatchUtil.MethodDefinition(typeof(BuildingInfo), nameof(BuildingInfo.InitializePrefab)),
                new PatchUtil.MethodDefinition(typeof(InitializePrefabPatch), nameof(PreInitializeHook)),
                new PatchUtil.MethodDefinition(typeof(InitializePrefabPatch), nameof(PostInitializeHook))
                );

            deployed = true;
        }
 public static void Apply()
 {
     PatchUtil.Patch(
         new PatchUtil.MethodDefinition(typeof(PostVanAI), "StartPathFind",
                                        BindingFlags.Default, new[]
     {
         typeof(ushort),
         typeof(Vehicle).MakeByRefType(),
         typeof(Vector3),
         typeof(Vector3),
         typeof(bool),
         typeof(bool),
         typeof(bool)
     }),
         null, null,
         new PatchUtil.MethodDefinition(typeof(VehicleTypeReplacingTranspiler), (nameof(VehicleTypeReplacingTranspiler.Transpile))));
 }
 private static void Transpile(Type type, string methodName)
 {
     PatchUtil.Patch(new PatchUtil.MethodDefinition(type, methodName),
                     null, null,
                     new PatchUtil.MethodDefinition(typeof(XYZBuildingAIPatch), nameof(TranspileMethod)));
 }