Exemplo n.º 1
0
        public override void Initialize(Harmony plibInstance)
        {
            Instance = this;

            // Non essential, do not crash on fail
            try {
                plibInstance.Patch(typeof(BuildingTemplates), nameof(BuildingTemplates.
                                                                     CreateBuildingDef), postfix: PatchMethod(nameof(
                                                                                                                  CreateBuildingDef_Postfix)));
                plibInstance.Patch(typeof(EquipmentTemplates), nameof(EquipmentTemplates.
                                                                      CreateEquipmentDef), postfix: PatchMethod(nameof(
                                                                                                                    CreateEquipmentDef_Postfix)));
            } catch (Exception e) {
#if DEBUG
                PUtil.LogExcWarn(e);
#endif
            }
            plibInstance.Patch(typeof(GeneratedBuildings), nameof(GeneratedBuildings.
                                                                  LoadGeneratedBuildings), prefix: PatchMethod(nameof(
                                                                                                                   LoadGeneratedBuildings_Prefix)));

            // Avoid another Harmony patch by using PatchManager
            var pm = new PPatchManager(plibInstance);
            pm.RegisterPatch(RunAt.AfterDbInit, new BuildingTechRegistration());
        }
Exemplo n.º 2
0
 internal static void PrepareSpamHandler(PPatchManager manager)
 {
     manager.RegisterPatchClass(typeof(SpamObjectsHandler));
     SpamObjectsAction = new PActionManager().CreateAction(
         "NotEnoughTags.SpamObjectsAction", "Spam objects under cursor",
         new PKeyBinding(KKeyCode.Y, Modifier.Ctrl));
 }
Exemplo n.º 3
0
        public override void OnLoad(Harmony instance)
        {
            base.OnLoad(instance);
            PUtil.InitLibrary();
            var pm = new PPatchManager(instance);

            pm.RegisterPatchClass(typeof(StockBugsPatches));
            pm.RegisterPatchClass(typeof(SweepFixPatches));
            FixModUpdateRace(instance);
            PRegistry.PutData("Bugs.TepidizerPulse", true);
            PRegistry.PutData("Bugs.TraitExclusionSpacedOut", true);
            PRegistry.PutData("Bugs.TropicalPacuRooms", true);
            PRegistry.PutData("Bugs.AutosaveDragFix", true);
            new POptions().RegisterOptions(this, typeof(StockBugFixOptions));
            new PVersionCheck().Register(this, new SteamVersionChecker());
        }
        public override void OnLoad(Harmony instance)
        {
            base.OnLoad(instance);
            PUtil.InitLibrary();
            var pm = new PPatchManager(instance);

            pm.RegisterPatchClass(typeof(StockBugsPatches));
#if false
            pm.RegisterPatchClass(typeof(SweepFixPatches));
#endif
            FixModUpdateRace(instance);
            PRegistry.PutData("Bugs.FishReleaseCount", true);
            PRegistry.PutData("Bugs.TepidizerPulse", true);
            PRegistry.PutData("Bugs.TraitExclusionSpacedOut", true);
            PRegistry.PutData("Bugs.JoyReactionFix", true);
            new POptions().RegisterOptions(this, typeof(StockBugFixOptions));
            new PVersionCheck().Register(this, new SteamVersionChecker());
        }