Пример #1
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(FloatMenuMakerMap), "GotoLocationOption"),
                          prefix: new HarmonyMethod(typeof(Pathing),
                                                    nameof(GotoLocationShips)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_PathFollower), nameof(Pawn_PathFollower.StartPath)),
                          prefix: new HarmonyMethod(typeof(Pathing),
                                                    nameof(StartVehiclePath)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_PathFollower), "NeedNewPath"),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(IsVehicleInNextCell)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathFinder), nameof(PathFinder.FindPath), new Type[] { typeof(IntVec3), typeof(LocalTargetInfo), typeof(TraverseParms), typeof(PathEndMode) }),
                          transpiler: new HarmonyMethod(typeof(Pathing),
                                                        nameof(PathAroundVehicles)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Reachability), nameof(Reachability.CanReach), new Type[] { typeof(IntVec3), typeof(LocalTargetInfo), typeof(PathEndMode), typeof(TraverseParms) }),
                          prefix: new HarmonyMethod(typeof(Pathing),
                                                    nameof(CanReachVehiclePosition)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(GenGrid), nameof(GenGrid.Impassable)),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(ImpassableThroughVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathGrid), nameof(PathGrid.Walkable)),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(WalkableThroughVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathGrid), nameof(PathGrid.WalkableFast), new Type[] { typeof(IntVec3) }),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(WalkableFastThroughVehicleIntVec3)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathGrid), nameof(PathGrid.WalkableFast), new Type[] { typeof(int), typeof(int) }),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(WalkableFastThroughVehicleInt2)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathGrid), nameof(PathGrid.WalkableFast), new Type[] { typeof(int) }),
                          postfix: new HarmonyMethod(typeof(Pathing),
                                                     nameof(WalkableFastThroughVehicleInt)));
 }
Пример #2
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(MapPawns), nameof(MapPawns.FreeColonistsSpawnedOrInPlayerEjectablePodsCount)).GetGetMethod(), prefix: null,
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(FreeColonistsInVehiclesTransport)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(MapPawns), nameof(MapPawns.FreeHumanlikesSpawnedOfFaction)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(FreeHumanlikesSpawnedInVehicles)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(MapPawns), nameof(MapPawns.FreeHumanlikesOfFaction)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(FreeHumanlikesInVehicles)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Selector), "HandleMapClicks"),
                          prefix: new HarmonyMethod(typeof(Extra),
                                                    nameof(MultiSelectFloatMenu)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(MentalState_Manhunter), nameof(MentalState_Manhunter.ForceHostileTo), new Type[] { typeof(Thing) }), prefix: null,
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(ManhunterDontAttackVehicles)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Projectile_Explosive), "Impact"),
                          prefix: new HarmonyMethod(typeof(Extra),
                                                    nameof(ShellsImpactWater)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WindowStack), nameof(WindowStack.Notify_ClickedInsideWindow)),
                          prefix: new HarmonyMethod(typeof(Extra),
                                                    nameof(HandleSingleWindowDialogs)));
     VehicleHarmony.Patch(original: AccessTools.PropertyGetter(typeof(TickManager), nameof(TickManager.Paused)),
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(PausedFromVehicles)));
     VehicleHarmony.Patch(original: AccessTools.PropertyGetter(typeof(TickManager), nameof(TickManager.CurTimeSpeed)),
                          postfix: new HarmonyMethod(typeof(Extra),
                                                     nameof(ForcePauseFromVehicles)));
 }
Пример #3
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(InspectPaneFiller), nameof(InspectPaneFiller.DoPaneContentsFor)),
                          postfix: new HarmonyMethod(typeof(WorldObjects),
                                                     nameof(AerialVehicleInFlightAltimeter)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(World), nameof(World.WorldUpdate)),
                          postfix: new HarmonyMethod(typeof(WorldObjects),
                                                     nameof(TextMeshWorldUpdate)));
 }
Пример #4
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn), "TicksPerMove"),
                          prefix: new HarmonyMethod(typeof(Upgrades),
                                                    nameof(VehicleMoveSpeedUpgradeModifier)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(MassUtility), nameof(MassUtility.Capacity)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Upgrades),
                                                     nameof(VehicleCargoCapacity)));
 }
Пример #5
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanFormingUtility), nameof(CaravanFormingUtility.IsFormingCaravan)),
                          prefix: new HarmonyMethod(typeof(CaravanFormation),
                                                    nameof(IsFormingCaravanVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(TransferableUtility), nameof(TransferableUtility.CanStack)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanFormation),
                                                        nameof(CanStackVehicleTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(GiveToPackAnimalUtility), nameof(GiveToPackAnimalUtility.UsablePackAnimalWithTheMostFreeSpace)),
                          prefix: new HarmonyMethod(typeof(CaravanFormation),
                                                    nameof(UsableVehicleWithMostFreeSpace)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(FloatMenuMakerMap), "AddHumanlikeOrders"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanFormation),
                                                        nameof(AddHumanLikeOrdersLoadVehiclesTranspiler)));
 }
Пример #6
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Frame), nameof(Frame.CompleteConstruction)),
                          prefix: new HarmonyMethod(typeof(Construction),
                                                    nameof(CompleteConstructionVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(ListerBuildingsRepairable), nameof(ListerBuildingsRepairable.Notify_BuildingRepaired)),
                          prefix: new HarmonyMethod(typeof(Construction),
                                                    nameof(Notify_RepairedVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(GenSpawn), name: nameof(GenSpawn.Spawn), new Type[] { typeof(Thing), typeof(IntVec3), typeof(Map), typeof(Rot4), typeof(WipeMode), typeof(bool) }),
                          prefix: new HarmonyMethod(typeof(Construction),
                                                    nameof(RegisterThingSpawned)));
     VehicleHarmony.Patch(original: AccessTools.PropertyGetter(typeof(DesignationCategoryDef), nameof(DesignationCategoryDef.ResolvedAllowedDesignators)),
                          postfix: new HarmonyMethod(typeof(Construction),
                                                     nameof(RemoveDisabledVehicles)));
 }
Пример #7
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(BeachMaker), nameof(BeachMaker.Init)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(MapHandling),
                                                        nameof(BeachMakerTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(TileFinder), nameof(TileFinder.RandomSettlementTileFor)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(MapHandling),
                                                        nameof(PushSettlementToCoastTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PathGrid), nameof(PathGrid.RecalculatePerceivedPathCostUnderThing)), prefix: null,
                          postfix: new HarmonyMethod(typeof(MapHandling),
                                                     nameof(RecalculateShipPathCostUnderThing)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(MapPawns), nameof(MapPawns.AnyPawnBlockingMapRemoval)).GetGetMethod(), prefix: null,
                          postfix: new HarmonyMethod(typeof(MapHandling),
                                                     nameof(AnyVehicleBlockingMapRemoval)));
 }
Пример #8
0
        public void DrawButton()
        {
            var  color      = GUI.color;
            Rect buttonRect = new Rect(0, 0, 80, 80);

            if (Mouse.IsOver(buttonRect))
            {
                GUI.color = GenUI.MouseoverColor;
            }
            GUI.DrawTexture(buttonRect, VehicleTex.BetaButtonIcon);
            if (Widgets.ButtonInvisible(buttonRect))
            {
                VehicleHarmony.OpenBetaDialog();
            }
            GUI.color = color;
        }
Пример #9
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(JobUtility), nameof(JobUtility.TryStartErrorRecoverJob)),
                          prefix: new HarmonyMethod(typeof(Jobs),
                                                    nameof(VehicleErrorRecoverJob)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(JobGiver_Wander), "TryGiveJob"),
                          prefix: new HarmonyMethod(typeof(Jobs),
                                                    nameof(VehiclesDontWander)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_JobTracker), nameof(Pawn_JobTracker.CheckForJobOverride)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(Jobs),
                                                        nameof(NoOverrideDamageTakenTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(JobDriver_PrepareCaravan_GatherItems), "Transferables").GetGetMethod(nonPublic: true),
                          prefix: new HarmonyMethod(typeof(Jobs),
                                                    nameof(TransferablesVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(ThingRequest), nameof(ThingRequest.Accepts)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Jobs),
                                                     nameof(AcceptsVehicleRefuelable)));
 }
Пример #10
0
        public void PatchMethods()
        {
            if (VehicleHarmony.debug)
            {
                VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldRoutePlanner), nameof(WorldRoutePlanner.WorldRoutePlannerUpdate)), prefix: null,
                                     postfix: new HarmonyMethod(typeof(Debug),
                                                                nameof(DebugSettlementPaths)));
                VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldObjectsHolder), nameof(WorldObjectsHolder.Add)),
                                     prefix: new HarmonyMethod(typeof(Debug),
                                                               nameof(DebugWorldObjects)));
                VehicleHarmony.Patch(original: AccessTools.Method(typeof(RegionGrid), nameof(RegionGrid.DebugDraw)), prefix: null,
                                     postfix: new HarmonyMethod(typeof(Debug),
                                                                nameof(DebugDrawWaterRegion)));
            }

            //VehicleHarmony.Patch(original: AccessTools.Method(typeof(Game), nameof(Game.AddMap)),
            //	postfix: new HarmonyMethod(typeof(Debug),
            //	nameof(TestMethod)));
        }
Пример #11
0
        public void PatchMethods()
        {
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldPawns), nameof(WorldPawns.GetSituation)), prefix: null,
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(SituationBoardedVehicle)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldPawns), nameof(WorldPawns.RemoveAndDiscardPawnViaGC)),
                                 prefix: new HarmonyMethod(typeof(WorldHandling),
                                                           nameof(DoNotRemoveDockedBoats)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldDynamicDrawManager), name: nameof(WorldDynamicDrawManager.DrawDynamicWorldObjects)),
                                 transpiler: new HarmonyMethod(typeof(WorldHandling),
                                                               nameof(DrawDynamicAerialVehiclesTranspiler)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(ExpandableWorldObjectsUtility), name: nameof(ExpandableWorldObjectsUtility.ExpandableWorldObjectsOnGUI)),
                                 transpiler: new HarmonyMethod(typeof(WorldHandling),
                                                               nameof(ExpandableIconDetourAerialVehicleTranspiler)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldObjectsHolder), "AddToCache"),
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(AddVehicleObjectToCache)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldObjectsHolder), "RemoveFromCache"),
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(RemoveVehicleObjectToCache)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldObjectsHolder), "Recache"),
                                 prefix: new HarmonyMethod(typeof(WorldHandling),
                                                           nameof(RecacheVehicleObjectCache)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(CameraJumper), nameof(CameraJumper.TryShowWorld)),
                                 prefix: new HarmonyMethod(typeof(WorldHandling),
                                                           nameof(ForcedTargetingDontShowWorld)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(MainButtonWorker_ToggleWorld), nameof(MainButtonWorker_ToggleWorld.Activate)),
                                 prefix: new HarmonyMethod(typeof(WorldHandling),
                                                           nameof(ForcedTargetingDontToggleWorld)));

            /* World Targeter Event Handling */
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldTargeter), nameof(WorldTargeter.TargeterUpdate)),
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(WorldTargeterUpdate)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldTargeter), nameof(WorldTargeter.TargeterOnGUI)),
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(WorldTargeterOnGUI)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldTargeter), nameof(WorldTargeter.ProcessInputEvents)),
                                 postfix: new HarmonyMethod(typeof(WorldHandling),
                                                            nameof(WorldTargeterProcessInputEvents)));
        }
Пример #12
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Settlement), nameof(Settlement.GetCaravanGizmos)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Gizmos),
                                                     nameof(NoAttackSettlementWhenDocked)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Settlement), nameof(Settlement.GetGizmos)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Gizmos),
                                                     nameof(AddVehicleCaravanGizmoPassthrough)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(FormCaravanComp), nameof(FormCaravanComp.GetGizmos)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Gizmos),
                                                     nameof(AddVehicleGizmosPassthrough)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanFormingUtility), nameof(CaravanFormingUtility.GetGizmos)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Gizmos),
                                                     nameof(GizmosForVehicleCaravans)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Designator_Build), nameof(Designator_Build.GizmoOnGUI)),
                          prefix: new HarmonyMethod(typeof(Gizmos),
                                                    nameof(VehicleMaterialOnBuildGizmo)));
     //VehicleHarmony.Patch(original: AccessTools.Method(typeof(Command), nameof(Command.GizmoOnGUI)),
     //    prefix: new HarmonyMethod(typeof(Gizmos),
     //    nameof(VehicleMaterialOnCopyBuildGizmo)));
 }
Пример #13
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.PropertyGetter(typeof(Projectile), "StartingTicksToImpact"),
                          postfix: new HarmonyMethod(typeof(Projectiles),
                                                     nameof(StartingTicksFromTurret)));
     VehicleHarmony.Patch(original: AccessTools.PropertyGetter(typeof(Projectile), nameof(Projectile.HitFlags)),
                          postfix: new HarmonyMethod(typeof(Projectiles),
                                                     nameof(OverriddenHitFlags)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Projectile), "CanHit"),
                          prefix: new HarmonyMethod(typeof(Projectiles),
                                                    nameof(TurretHitFlags)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Projectile), "Impact"),
                          prefix: new HarmonyMethod(typeof(Projectiles),
                                                    nameof(ImpactVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(DamageWorker), "ExplosionDamageThing"),
                          postfix: new HarmonyMethod(typeof(Projectiles),
                                                     nameof(ExplosionDamageVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Thing), nameof(Thing.Destroy)),
                          prefix: new HarmonyMethod(typeof(Projectiles),
                                                    nameof(ProjectileMapToWorld)));
 }
Пример #14
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(Pawn_DraftController), nameof(Pawn_DraftController.Drafted)).GetSetMethod(),
                          prefix: new HarmonyMethod(typeof(Components),
                                                    nameof(DraftedVehiclesCanMove)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(FloatMenuMakerMap), "CanTakeOrder"), prefix: null,
                          postfix: new HarmonyMethod(typeof(Components),
                                                     nameof(CanVehicleTakeOrder)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(FloatMenuUtility), nameof(FloatMenuUtility.GetMeleeAttackAction)),
                          prefix: new HarmonyMethod(typeof(Components),
                                                    nameof(NoMeleeForVehicles))); //Change..?
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PawnComponentsUtility), nameof(PawnComponentsUtility.CreateInitialComponents)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Components),
                                                     nameof(CreateInitialVehicleComponents)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PawnComponentsUtility), nameof(PawnComponentsUtility.AddAndRemoveDynamicComponents)), prefix: null,
                          postfix: new HarmonyMethod(typeof(Components),
                                                     nameof(AddAndRemoveVehicleComponents)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_MeleeVerbs), "ChooseMeleeVerb"),
                          prefix: new HarmonyMethod(typeof(Components),
                                                    nameof(VehiclesDontMeleeThings)));
 }
Пример #15
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldSelector), "AutoOrderToTileNow"),
                          prefix: new HarmonyMethod(typeof(WorldPathing),
                                                    nameof(AutoOrderVehicleCaravanPathing)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Caravan_PathFollower), "StartPath"),
                          prefix: new HarmonyMethod(typeof(WorldPathing),
                                                    nameof(StartVehicleCaravanPath)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(TilesPerDayCalculator), nameof(TilesPerDayCalculator.ApproxTilesPerDay), new Type[] { typeof(Caravan), typeof(StringBuilder) }),
                          prefix: new HarmonyMethod(typeof(WorldPathing),
                                                    nameof(ApproxTilesForShips)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldRoutePlanner), nameof(WorldRoutePlanner.WorldRoutePlannerUpdate)),
                          prefix: new HarmonyMethod(typeof(WorldPathing),
                                                    nameof(VehicleRoutePlannerUpdateHook)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldRoutePlanner), nameof(WorldRoutePlanner.WorldRoutePlannerOnGUI)),
                          prefix: new HarmonyMethod(typeof(WorldPathing),
                                                    nameof(VehicleRoutePlannerOnGUIHook)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WorldRoutePlanner), nameof(WorldRoutePlanner.DoRoutePlannerButton)), prefix: null,
                          postfix: new HarmonyMethod(typeof(WorldPathing),
                                                     nameof(VehicleRoutePlannerButton)));
 }
Пример #16
0
        public void PatchMethods()
        {
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_RotationTracker), nameof(Pawn_RotationTracker.UpdateRotation)),
                                 prefix: new HarmonyMethod(typeof(Rendering),
                                                           nameof(UpdateVehicleRotation)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(ColonistBar), "CheckRecacheEntries"), prefix: null, postfix: null,
                                 transpiler: new HarmonyMethod(typeof(Rendering),
                                                               nameof(CheckRecacheEntriesTranspiler)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(ColonistBarColonistDrawer), "DrawIcons"), prefix: null,
                                 postfix: new HarmonyMethod(typeof(Rendering),
                                                            nameof(DrawIconsVehicles)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(SelectionDrawer), "DrawSelectionBracketFor"),
                                 prefix: new HarmonyMethod(typeof(Rendering),
                                                           nameof(DrawSelectionBracketsVehicles)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(PawnFootprintMaker), nameof(PawnFootprintMaker.FootprintMakerTick)),
                                 prefix: new HarmonyMethod(typeof(Rendering),
                                                           nameof(BoatWakesTicker)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(PawnTweener), "TweenedPosRoot"),
                                 prefix: new HarmonyMethod(typeof(Rendering),
                                                           nameof(VehicleTweenedPosRoot)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(GhostDrawer), nameof(GhostDrawer.DrawGhostThing)),
                                 postfix: new HarmonyMethod(typeof(Rendering),
                                                            nameof(DrawGhostVehicle)));
            //harmony.Patch(original: AccessTools.Method(typeof(ThingDefGenerator_Buildings), "NewBlueprintDef_Thing"),
            //    postfix: new HarmonyMethod(typeof(Rendering),
            //    nameof(VehicleCannonsBlueprintDraw)));

            //Change targeter to transpiler on UIRoot_Play
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(Targeter), nameof(Targeter.TargeterOnGUI)),
                                 postfix: new HarmonyMethod(typeof(Rendering),
                                                            nameof(DrawTargeters)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(Targeter), nameof(Targeter.ProcessInputEvents)),
                                 postfix: new HarmonyMethod(typeof(Rendering),
                                                            nameof(ProcessTargeterInputEvents)));
            VehicleHarmony.Patch(original: AccessTools.Method(typeof(Targeter), nameof(Targeter.TargeterUpdate)),
                                 postfix: new HarmonyMethod(typeof(Rendering),
                                                            nameof(TargeterUpdate)));
        }
Пример #17
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(HealthUtility), nameof(HealthUtility.GetGeneralConditionLabel)),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(ReplaceConditionLabel)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Pawn_HealthTracker), "ShouldBeDowned"),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(VehicleShouldBeDowned)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(PawnDownedWiggler), nameof(PawnDownedWiggler.WigglerTick)),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(VehicleShouldWiggle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(HediffUtility), nameof(HediffUtility.CanHealNaturally)),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(VehiclesDontHeal)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(HediffUtility), nameof(HediffUtility.CanHealFromTending)),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(VehiclesDontHealTended)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Widgets), nameof(Widgets.InfoCardButton), new Type[] { typeof(float), typeof(float), typeof(Thing) }),
                          transpiler: new HarmonyMethod(typeof(HealthAndStats),
                                                        nameof(InfoCardVehiclesTranspiler))); //REDO - change to remove info card button rather than patching the widget
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Verb_CastAbility), nameof(Verb_CastAbility.CanHitTarget)),
                          prefix: new HarmonyMethod(typeof(HealthAndStats),
                                                    nameof(VehiclesImmuneToPsycast)));
 }
Пример #18
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Dialog_FormCaravan), "TryReformCaravan"),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(ConfirmLeaveVehiclesOnReform)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CollectionsMassCalculator), nameof(CollectionsMassCalculator.Capacity), new Type[] { typeof(List <ThingCount>), typeof(StringBuilder) }),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(CapacityWithVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(MassUtility), nameof(MassUtility.CanEverCarryAnything)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(CanCarryIfVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(ITab_Pawn_FormingCaravan), "FillTab"),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(FillTabVehicleCaravan)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(ITab_Pawn_FormingCaravan), "DoPeopleAndAnimals"),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(DoPeopleAnimalsAndVehicle)));
     //VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanArrivalAction_Enter), nameof(CaravanArrivalAction_Enter.Arrived)), prefix: null, postfix: null,
     //    transpiler: new HarmonyMethod(typeof(CaravanHandling),
     //    nameof(VehiclesArrivedTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanArrivalAction_VisitEscapeShip), "DoArrivalAction"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(ShipsVisitEscapeShipTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(SettlementUtility), "AttackNow"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(AttackNowWithShipsTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanArrivalAction_VisitSite), "DoEnter"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(DoEnterWithShipsTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanEnterMapUtility), nameof(CaravanEnterMapUtility.Enter), new Type[] { typeof(Caravan), typeof(Map), typeof(CaravanEnterMode), typeof(CaravanDropInventoryMode), typeof(bool), typeof(Predicate <IntVec3>) }),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(EnterMapVehiclesCatchAll1)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanEnterMapUtility), nameof(CaravanEnterMapUtility.Enter), new Type[] { typeof(Caravan), typeof(Map), typeof(Func <Pawn, IntVec3>), typeof(CaravanDropInventoryMode), typeof(bool) }),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(EnterMapVehiclesCatchAll2)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(Caravan), nameof(Caravan.AllOwnersDowned)).GetGetMethod(),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(AllOwnersDownedVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(Caravan), nameof(Caravan.AllOwnersHaveMentalBreak)).GetGetMethod(),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(AllOwnersMentalBreakVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(Caravan), nameof(Caravan.NightResting)).GetGetMethod(),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(NoRestForVehicles)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Caravan), nameof(Caravan.ContainsPawn)), prefix: null,
                          postfix: new HarmonyMethod(typeof(CaravanHandling),
                                                     nameof(ContainsPawnInVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Caravan), nameof(Caravan.IsOwner)), prefix: null,
                          postfix: new HarmonyMethod(typeof(CaravanHandling),
                                                     nameof(IsOwnerOfVehicle)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(SettlementDefeatUtility), nameof(SettlementDefeatUtility.CheckDefeated)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(CheckDefeatedWithVehiclesTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Tale_DoublePawn), nameof(Tale_DoublePawn.Concerns)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(ConcernNullThing)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WITab_Caravan_Needs), "FillTab"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(VehicleNeedsFillTabTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(WITab_Caravan_Needs), "UpdateSize"), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(VehicleNeedsUpdateSizeTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(WITab_Caravan_Gear), "Pawns").GetGetMethod(nonPublic: true), prefix: null,
                          postfix: new HarmonyMethod(typeof(CaravanHandling),
                                                     nameof(VehicleGearTabPawns)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanInventoryUtility), nameof(CaravanInventoryUtility.AllInventoryItems)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(VehicleAllInventoryItems)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Settlement_TraderTracker), nameof(Settlement_TraderTracker.ColonyThingsWillingToBuy)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(AerialVehicleInventoryItems)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanInventoryUtility), nameof(CaravanInventoryUtility.GiveThing)), prefix: null, postfix: null,
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(VehicleGiveThingInventoryTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(WITab_Caravan_Health), "Pawns").GetGetMethod(nonPublic: true),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(VehicleHealthTabPawns)));
     VehicleHarmony.Patch(original: AccessTools.Property(typeof(WITab_Caravan_Social), "Pawns").GetGetMethod(nonPublic: true),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(VehicleSocialTabPawns)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(BestCaravanPawnUtility), nameof(BestCaravanPawnUtility.FindPawnWithBestStat)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(FindPawnInVehicleWithBestStat)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanArrivalAction_OfferGifts), nameof(CaravanArrivalAction_OfferGifts.Arrived)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(UnloadVehicleOfferGifts)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Settlement_TraderTracker), nameof(Settlement_TraderTracker.GiveSoldThingToPlayer)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(GiveSoldThingToAerialVehicle)),
                          transpiler: new HarmonyMethod(typeof(CaravanHandling),
                                                        nameof(GiveSoldThingToVehicleTranspiler)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(Caravan_NeedsTracker), "TrySatisfyPawnNeeds"),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(TrySatisfyVehiclePawnsNeeds)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanUtility), nameof(CaravanUtility.IsCaravanMember)), prefix: null,
                          postfix: new HarmonyMethod(typeof(CaravanHandling),
                                                     nameof(IsParentCaravanMember)));
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(CaravanUtility), nameof(CaravanUtility.RandomOwner)),
                          prefix: new HarmonyMethod(typeof(CaravanHandling),
                                                    nameof(RandomVehicleOwner)));
 }
Пример #19
0
 public void PatchMethods()
 {
     VehicleHarmony.Patch(original: AccessTools.Method(typeof(GatheringsUtility), nameof(GatheringsUtility.ShouldGuestKeepAttendingGathering)),
                          prefix: new HarmonyMethod(typeof(LordAI),
                                                    nameof(VehiclesDontParty)));
 }