private void On_PlayerCharacterMasterController_CheckPinging(On.RoR2.PlayerCharacterMasterController.orig_CheckPinging orig, PlayerCharacterMasterController self) { if (!self.hasEffectiveAuthority || !self.body || !self.bodyInputs) { return; } var menuTracker = self.gameObject.GetComponent <PingMenuInstanceTracker>(); if (!menuTracker) { menuTracker = self.gameObject.AddComponent <PingMenuInstanceTracker>(); } if (self.bodyInputs.ping.down) { menuTracker.btnHoldStopwatch += Time.unscaledDeltaTime; } else { menuTracker.btnHoldStopwatch = 0f; menuTracker.btnHoldActioned = false; } if (menuTracker.btnHoldStopwatch > mainMenuOpenDelay && !menuTracker.latestMenu && !menuTracker.btnHoldActioned) { menuTracker.btnHoldActioned = true; menuTracker.latestMenu = MainPingMenuBindings.instance.Instantiate(self); } else if (self.bodyInputs.ping.justReleased) { if (menuTracker.latestMenu) { menuTracker.btnHoldActioned = false; var cpt = menuTracker.latestMenu.GetComponent <ProceduralRadialMenu>(); if (cpt.inOutState != ProceduralRadialMenu.InOutState.Outro) { cpt.Activate(false); menuTracker.latestMenu = null; return; } menuTracker.latestMenu = null; } if (!menuTracker.btnHoldActioned) { MiscUtil.DefaultPing(self); } menuTracker.btnHoldActioned = false; } }