/** * Ignore execution of the PauseGameToggle method if represents an unpause due to UI elements * overlapping the pause menu */ private IEnumerator GameManagerOnPauseGameToggle( On.GameManager.orig_PauseGameToggle orig, global::GameManager self ) { if (!_netClient.IsConnected) { yield return(orig(self)); yield break; } var stackTrace = new StackTrace(); var frames = stackTrace.GetFrames(); if (frames == null) { yield return(orig(self)); yield break; } var methodName = frames[1].GetMethod().Name; if (methodName.Equals("MoveNext")) { yield break; } yield return(orig(self)); }
private static IEnumerator OnGamePause(On.GameManager.orig_PauseGameToggle orig, GameManager self) { GameManager.instance.StartCoroutine(orig(self)); bool paused = GameManager.instance.IsGamePaused(); Panel.SetActive(paused, !paused); yield return(null); }
private IEnumerator PatchSuperslides(On.GameManager.orig_PauseGameToggle orig, GameManager self) { // Check if the player is in a valid state to superslide if (!MiniDebug.Instance.Superslides || PlayerData.instance.disablePause || self.gameState != GameState.PLAYING || !self.GetField <GameManager, bool>("timeSlowed")) { yield return(orig(self)); yield break; } // Remove the freezeframe lock on pausing, reset recoil to ensure max speed self.SetField("timeSlowed", false); HeroController.instance.SetField("recoilSteps", 0); // Pause the game to cause a superslide yield return(orig(self)); // Setting timeSlowed back to true causes the pause menu to be uncloseable // The freezeframe that slowed time is definitely over by now // orig_PauseGameToggle contains a large delay }