public void ILThenOn()
 {
     hIL = new ILHook(
         typeof(OnIL).GetMethod("DoNothing"),
         il => {
         ILCursor c = new ILCursor(il);
         c.EmitDelegate <Action>(() => {
             hILRun = true;
         });
     },
         new ILHookConfig {
         ManualApply = false
     }
         );
     h1 = new Hook(
         typeof(OnIL).GetMethod("DoNothing"),
         new Action <Action <OnIL>, OnIL>((orig, self) => {
         orig(self);
         h1Run = true;
     }),
         new HookConfig {
         ManualApply = false
     }
         );
     h1Run  = false;
     hILRun = false;
     DoNothing();
     Assert.True(h1Run);
     Assert.True(hILRun);
     h1.Dispose();
     hIL.Dispose();
 }
Beispiel #2
0
        public static void deactivateHooks()
        {
            if (!hooksActive)
            {
                return;
            }
            hooksActive = false;

            Logger.Log(LogLevel.Info, "MaxHelpingHand/UpsideDownJumpThru", "=== Deactivating upside-down jumpthru hooks");

            On.Celeste.Actor.MoveVExact -= onActorMoveVExact;
            On.Celeste.Platform.MoveVExactCollideSolids -= onPlatformMoveVExactCollideSolids;

            On.Celeste.Player.OnCollideV  -= onPlayerOnCollideV;
            IL.Celeste.Player.ClimbUpdate -= patchPlayerClimbUpdate;

            playerOrigUpdateHook?.Dispose();
            IL.Celeste.Player.DashUpdate    -= filterOutJumpThrusFromCollideChecks;
            IL.Celeste.Player.RedDashUpdate -= filterOutJumpThrusFromCollideChecks;

            On.Celeste.Player.Update -= onPlayerUpdate;

            On.Celeste.JumpThru.HasPlayerRider -= onJumpthruHasPlayerRider;

            canUnDuckHook?.Dispose();
            canUnDuckHook = null;
        }
 public static void Unload()
 {
     IL.Celeste.NorthernLights.ctor         -= hookConstructor;
     IL.Celeste.NorthernLights.BeforeRender -= hookBeforeRender;
     strandILHook?.Dispose();
     strandILHook = null;
 }
        internal static void Unload()
        {
            On.Celeste.Level.LoadLevel -= onLoadLevel;
            On.Celeste.Player.Update   -= onPlayerUpdate;

            hookOnLevelSetSwitch?.Dispose();
            IL.Celeste.Mod.UI.OuiMapSearch.ReloadItems -= modMapSearch;
            IL.Celeste.Mod.UI.OuiMapList.ReloadItems   -= modMapListReloadItems;
            IL.Celeste.Mod.UI.OuiMapList.CreateMenu    -= modMapListCreateMenu;
            IL.Celeste.Mod.UI.OuiFileSelectSlotLevelSetPicker.changeStartingLevelSet -= modFileSelectChangeStartingLevelSet;

            On.Celeste.SaveData.RegisterHeartGem   -= onRegisterHeartGem;
            On.Celeste.SaveData.RegisterPoemEntry  -= onRegisterPoemEntry;
            On.Celeste.SaveData.RegisterCompletion -= onRegisterCompletion;
            On.Celeste.SaveData.AfterInitialize    -= onSaveDataAfterInitialize;
            On.Celeste.OuiChapterSelectIcon.AssistModeUnlockRoutine -= onAssistUnlockRoutine;
            Everest.Events.Journal.OnEnter    -= onJournalEnter;
            On.Celeste.OuiFileSelectSlot.Show -= onOuiFileSelectSlotShow;

            hookOnOuiFileSelectRenderDisplayName?.Dispose();
            hookOnOuiFileSelectRenderStrawberryStamp?.Dispose();
            hookOnOuiJournalPoemLines?.Dispose();
            hookOnOuiFileSelectSlotGolden?.Dispose();
            hookOnOuiFileSelectSlotRender?.Dispose();

            if (Everest.Loader.DependencyLoaded(new EverestModuleMetadata()
            {
                Name = "CelesteNet.Client", Version = new Version(2, 0, 0)
            }))
            {
                teardownAdjustCollabIcon();
            }
        }
        public override void Unload()
        {
            On.Celeste.Player.Jump          -= OnPlayerJump;
            On.Celeste.Player.DashBegin     -= OnPlayerDashBegin;
            On.Celeste.Player.Die           -= OnPlayerDie;
            On.Celeste.PlayerSprite.ctor    -= OnPlayerSprite_ctor;
            On.Celeste.Distort.Render       -= OnDistortRender;
            On.Celeste.Player.Update        -= OnPlayerUpdate;
            On.Celeste.Level.LoadLevel      -= OnLevelLoadLevel;
            On.Celeste.Strawberry.OnCollect -= OnStrawberryOnCollect;
            On.Celeste.Key.OnPlayer         -= OnKeyOnPlayer;
            On.Celeste.Key.RegisterUsed     -= OnKeyRegisterUsed;
            On.Celeste.Player.Duck          -= OnPlayerDuck;
            On.Celeste.Level.CompleteArea_bool_bool_bool -= OnLevelCompleteArea;
            On.Celeste.HeartGem.Collect      -= OnHeartGemCollect;
            On.Celeste.Player.UseRefill      -= OnPlayerUseRefill;
            On.Celeste.Spring.OnCollide      -= OnSpringOnCollide;
            On.Celeste.Player.DreamDashBegin -= OnPlayerDreamDashBegin;
            On.Celeste.CutsceneEntity.Start  -= OnCutsceneEntityStart;

            IL.Monocle.Engine.Update   -= ILEngineUpdate;
            IL.Celeste.Bumper.OnPlayer -= ILBumperOnPlayer;
            ILPlayer_orig_Update.Dispose();
            ILPlayer_orig_Update = null;
            ILPlayerStarFlyCoroutine.Dispose();
            ILPlayerStarFlyCoroutine = null;
        }
 public static void Unload()
 {
     origLoadLevelHook.Dispose();
     loadCustomEntityHook.Dispose();
     On.Monocle.Entity.Added -= EntityOnAdded;
     CustomEntityId2Utils.OnUnload();
 }
Beispiel #7
0
 public override void Unload()
 {
     if (wallJumpHook != null)
     {
         wallJumpHook.Dispose();
     }
 }
Beispiel #8
0
 public override void Unload()
 {
     Everest.Events.MainMenu.OnCreateButtons       -= CreateMainMenuButtons;
     Everest.Events.Level.OnCreatePauseMenuButtons -= CreatePauseMenuButtons;
     nluaAssemblyGetTypesHook?.Dispose();
     nluaAssemblyGetTypesHook = null;
 }
Beispiel #9
0
 public override void Unload()
 {
     if (wallJumpHook != null)
     {
         wallJumpHook.Dispose();
     }
     On.Celeste.Player.WallJumpCheck -= modWallJumpCheck;
 }
Beispiel #10
0
        public override void Unload()
        {
            IL.Celeste.BounceBlock.ShakeOffPlayer -= onJumpGraceTimerReset;
            IL.Celeste.Player.DreamDashEnd        -= modCoyoteTime;

            hookOrigUpdate?.Dispose();
            hookOrigUpdate = null;
        }
        public override void Unload()
        {
            dashCoroutineHook?.Dispose();
            redDashCoroutineHook?.Dispose();

            dashCoroutineHook    = null;
            redDashCoroutineHook = null;
        }
        public static void Unload()
        {
            On.Celeste.SwapBlock.ctor_EntityData_Vector2 -= onSwapBlockConstruct;
            IL.Celeste.SwapBlock.ctor_Vector2_float_float_Vector2_Themes -= modSwapBlockTexturesInConstructor;

            hookOnPathRendererConstructor?.Dispose();
            hookOnPathRendererConstructor = null;
        }
Beispiel #13
0
 private static void Unload()
 {
     On.Monocle.Engine.Update            -= EngineOnUpdate;
     On.Monocle.Scene.AfterUpdate        -= SceneOnAfterUpdate;
     Everest.Events.Level.OnTransitionTo -= LevelOnOnTransitionTo;
     On.Celeste.Level.Update             -= LevelOnUpdate;
     dashCoroutineIlHook?.Dispose();
     dashCoroutineIlHook = null;
 }
 public override void Unload()
 {
     IL.Celeste.Bumper.OnPlayer           -= wrapExplodeLaunchCall;
     IL.Celeste.Puffer.Explode            -= wrapExplodeLaunchCall;
     IL.Celeste.TempleBigEyeball.OnPlayer -= wrapExplodeLaunchCall;
     if (seekerRegenerateHook != null)
     {
         seekerRegenerateHook.Dispose();
     }
 }
        public override void Unload()
        {
            IL.Celeste.Player.LaunchedBoostCheck -= hookLiftBoostUsages;
            IL.Celeste.Player.Jump          -= hookLiftBoostUsages;
            IL.Celeste.Player.SuperJump     -= hookLiftBoostUsages;
            IL.Celeste.Player.SuperWallJump -= hookLiftBoostUsages;

            playerOrigWallJumpHook?.Dispose();
            playerOrigWallJumpHook = null;
        }
Beispiel #16
0
 public override void Unload()
 {
     IL.Celeste.Player.Jump          -= modJump;
     IL.Celeste.Player.SuperJump     -= modSuperJump;
     IL.Celeste.Player.SuperWallJump -= modSuperWallJump;
     if (wallJumpHook != null)
     {
         wallJumpHook.Dispose();
     }
 }
        public static void Unload()
        {
            hookOrigUpdate?.Dispose();
            hookLoadLevel?.Dispose();
            hookTransitionRoutine?.Dispose();

            hookOrigUpdate        = null;
            hookLoadLevel         = null;
            hookTransitionRoutine = null;
        }
        public static void Unload()
        {
            IL.Celeste.Mod.Everest.Content.Crawl -= registerLazyLoadingModsOnLoad;
            IL.Monocle.VirtualTexture.Preload    -= turnOnLazyLoadingSelectively;
            On.Celeste.LevelLoader.ctor          -= lazilyLoadTextures;
            On.Monocle.VirtualTexture.Reload     -= onTextureLazyLoad;
            Everest.Events.Level.OnExit          -= saveNewLazilyLoadedPaths;

            hookOnTextureSafe?.Dispose();
            hookOnTextureSafe = null;
        }
Beispiel #19
0
        private static void unhook()
        {
            if (hooked)
            {
                On.Celeste.DustStyles.Get_Scene   -= onGetDustStyle;
                On.Celeste.DustEdges.BeforeRender -= onDustEdgesBeforeRender;
                eyeballHook?.Dispose();
                eyeballHook = null;

                hooked = false;
            }
        }
Beispiel #20
0
        public static void Unload()
        {
            On.Celeste.Actor.MoveVExact -= onActorMoveVExact;
            On.Celeste.Platform.MoveVExactCollideSolids -= onPlatformMoveVExactCollideSolids;

            On.Celeste.Player.OnCollideV  -= onPlayerOnCollideV;
            IL.Celeste.Player.ClimbUpdate -= patchPlayerClimbUpdate;

            playerOrigUpdateHook?.Dispose();
            IL.Celeste.Player.DashUpdate    -= filterOutJumpThrusFromCollideChecks;
            IL.Celeste.Player.RedDashUpdate -= filterOutJumpThrusFromCollideChecks;
        }
Beispiel #21
0
 internal static void Unload()
 {
     IL.Celeste.Strawberry.Added -= modStrawberrySprite;
     collectRoutineHook?.Dispose();
     On.Celeste.Player.Die -= onPlayerDie;
     playerDeathRoutineHook?.Dispose();
     Everest.Events.Level.OnCreatePauseMenuButtons -= onCreatePauseMenuButtons;
     On.Celeste.Player.Added -= Player_Added;
     On.Celeste.SaveData.AddStrawberry_AreaKey_EntityID_bool -= onSaveDataAddStrawberry;
     On.Celeste.Strawberry.CollectRoutine -= onStrawberryCollectRoutine;
     On.Celeste.Level.End -= onLevelEnd;
 }
        public static void Unload()
        {
            movingTouchSwitchType             = null;
            movingTouchSwitchIcon             = null;
            movingTouchSwitchStateMachineType = null;

            hookMovingTouchSwitchColor?.Dispose();
            hookMovingTouchSwitchColor = null;

            On.Celeste.Switch.Activate    -= onSwitchActivate;
            On.Celeste.TouchSwitch.Update -= onTouchSwitchUpdate;
        }
Beispiel #23
0
        public override void Unload()
        {
            On.HeroController.CanOpenInventory -= CanOpenInventory;
            On.HeroController.CanQuickMap      -= CanQuickMap;
            On.TutorialEntryPauser.Start       -= AllowPause;
            On.HeroController.ShouldHardLand   -= CanHardLand;
            On.PlayMakerFSM.OnEnable           -= ModifyFSM;
            On.InputHandler.Update             -= EnableSuperslides;
            ModHooks.ObjectPoolSpawnHook       -= OnObjectPoolSpawn;
            USceneManager.activeSceneChanged   -= SceneChanged;

            _elevatorStorage?.Dispose();
        }
Beispiel #24
0
        public override void Unload()
        {
            On.Celeste.Player.DashBegin -= modDashBegin;

            if (dashCoroutineHookForTimer != null)
            {
                dashCoroutineHookForTimer.Dispose();
            }
            if (dashCoroutineHookForCounter != null)
            {
                dashCoroutineHookForCounter.Dispose();
            }
        }
Beispiel #25
0
        public override void Unload()
        {
            Logger.Log("SkinModHelper/SkinModHelperModule", "Unloading SkinModHelper");

            On.Monocle.SpriteBank.Create         -= SpriteBankCreateHook;
            On.Monocle.SpriteBank.CreateOn       -= SpriteBankCreateOnHook;
            On.Celeste.LevelLoader.LoadingThread -= LevelLoaderLoadingThreadHook;
            On.Celeste.Player.Render             -= PlayerRenderHook;

            On.Celeste.PlayerHair.GetHairTexture   -= PlayerHairGetHairTextureHook;
            IL.Celeste.CS06_Campfire.Question.ctor -= CampfireQuestionHook;
            TextboxRunRoutineHook.Dispose();
        }
Beispiel #26
0
        public static void Unload()
        {
            IL.Celeste.Strawberry.OnAnimate -= replaceStrawberryStrings;
            IL.Celeste.Strawberry.OnPlayer  -= replaceStrawberryStrings;
            strawberryCollectRoutineHook?.Dispose();
            strawberryCollectRoutineHook = null;

            IL.Celeste.Strawberry.Added -= replaceStrawberryStrings;

            On.Celeste.Strawberry.CollectRoutine -= onStrawberryCollect;
            On.Celeste.Strawberry.Update         -= onStrawberryUpdate;

            On.Celeste.MapData.Load -= onMapDataLoad;
        }
Beispiel #27
0
        public override void Unload()
        {
            IL.Celeste.Player.Bounce       -= patchNoRefills;
            IL.Celeste.Player.SuperBounce  -= patchNoRefills;
            IL.Celeste.Player.SideBounce   -= patchNoRefills;
            IL.Celeste.Player.DreamDashEnd -= patchNoRefills;

            On.Celeste.Bumper.OnPlayer            -= patchBumperOnPlayer;
            On.Celeste.Puffer.Explode             -= patchPufferExplode;
            On.Celeste.TempleBigEyeball.OnPlayer  -= patchTempleBigEyeballOnPlayer;
            On.Celeste.Seeker.RegenerateCoroutine -= patchSeekerRegenerateCoroutine;

            patchOrigUpdate?.Dispose();
            patchOrigUpdate = null;
        }
        public override void Unload()
        {
            IL.Celeste.Player.ClimbUpdate    -= patchOutStamina;
            IL.Celeste.Player.SwimBegin      -= patchOutStamina;
            IL.Celeste.Player.DreamDashBegin -= patchOutStamina;
            IL.Celeste.Player.ctor           -= patchOutStamina;
            On.Celeste.Player.RefillStamina  -= modRefillStamina;

            if (playerUpdateHook != null)
            {
                playerUpdateHook.Dispose();
            }
            if (summitGemSmashRoutineHook != null)
            {
                summitGemSmashRoutineHook.Dispose();
            }
        }
        public static void Unload()
        {
            hookIsHeartSide?.Dispose();
            hookIsHeartSide = null;

            hookLobbyJournal?.Dispose();
            hookLobbyJournal = null;

            hookOverworldJournal?.Dispose();
            hookOverworldJournal = null;

            IL.Celeste.Level.CompleteArea_bool_bool_bool -= modLevelComplete;
            IL.Celeste.OuiChapterPanel.Render            -= renderOldGMHSCompletionStamp;

            hookPoemColors?.Dispose();
            hookPoemColors = null;
        }
        public override void Unload()
        {
            //IL.Celeste.LightingRenderer.DrawLightOccluders -= LightingRenderer_DrawLightOccluders;

            Extensions.Unload();
            TileSeedController.Unload();

            On.Celeste.CrumbleWallOnRumble.Break -= FancyCrumbleWallOnRumble.Break;
            On.Celeste.DashBlock.Break_Vector2_Vector2_bool_bool -= FancyDashBlock.Break;
            On.Celeste.FallingBlock.LandParticles -= FancyFallingBlock.LandParticles;
            hook_FallingBlock_Sequence?.Dispose();
            On.Celeste.FinalBossMovingBlock.StopParticles   -= FancyFinalBossMovingBlock.StopParticles;
            On.Celeste.FinalBossMovingBlock.ImpactParticles -= FancyFinalBossMovingBlock.ImpactParticles;
            On.Celeste.FinalBossMovingBlock.Finish          -= FancyFinalBossMovingBlock.Finish;
            IL.Celeste.FloatySpaceBlock.Awake  -= FancyFloatySpaceBlock.Awake;
            On.Celeste.RidgeGate.EnterSequence -= FancyRidgeGate.EnterSequence;
        }