/// <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();
                }
            }
        }
Пример #2
0
        public override void OnReleased()
        {
            base.OnReleased();

            RenderManagerDetour.Revert();
            NetManagerDetour.Revert();
        }