/// <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 OnCreated(ILoading loading)
        {
            base.OnCreated(loading);

            RenderManagerDetour.Deploy();
            NetManagerDetour.Deploy();
        }