/// <summary> /// Deploys/un-deploys the mod by toggling the custom detours. /// </summary> /// <param name="toolEnabled"></param> private static void ToggleDetours(bool toolEnabled) { if (toolEnabled) { Log.Info($"[{nameof(ParallelRoadTool)}.{nameof(ToggleDetours)}] Enabling detours..."); NetManagerDetour.Deploy(); NetToolDetour.Deploy(); if (IsInGameMode) { NetAIDetour.Deploy(); } } else { Log.Info($"[{nameof(ParallelRoadTool)}.{nameof(ToggleDetours)}] Disabling detours..."); NetManagerDetour.Revert(); NetToolDetour.Revert(); if (IsInGameMode) { NetAIDetour.Revert(); } } }
public override void OnReleased() { base.OnReleased(); RenderManagerDetour.Revert(); NetManagerDetour.Revert(); }