Ejemplo n.º 1
0
        public void Start()
        {
            if (Instance != null)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            Satellites = new SatelliteManager();
            Antennas = new AntennaManager();
            Network = new NetworkManager();
            Renderer = NetworkRenderer.CreateAndAttach();

            FilterOverlay = new FilterOverlay();
            FocusOverlay = new FocusOverlay();
            TimeQuadrantPatcher = new TimeQuadrantPatcher();

            TimeQuadrantPatcher.Patch();
            FlightUIPatcher.Patch();

            RTLog.Notify("RTCore loaded successfully.");

            foreach (var vessel in FlightGlobals.Vessels)
            {
                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
Ejemplo n.º 2
0
        public void Start()
        {
            if (Instance != null)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            ctrlLockAddon = new AddOns.ControlLockAddon();

            Satellites = new SatelliteManager();
            Antennas   = new AntennaManager();
            Network    = new NetworkManager();
            Renderer   = NetworkRenderer.CreateAndAttach();

            FilterOverlay     = new FilterOverlay();
            FocusOverlay      = new FocusOverlay();
            TimeWarpDecorator = new TimeWarpDecorator();

            FlightUIPatcher.Patch();

            RTLog.Notify("RTCore {0} loaded successfully.", RTUtil.Version);

            foreach (var vessel in FlightGlobals.Vessels)
            {
                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
Ejemplo n.º 3
0
        public void OnDestroy()
        {
            if (FocusOverlay != null)
            {
                FocusOverlay.Dispose();
            }
            if (FilterOverlay != null)
            {
                FilterOverlay.Dispose();
            }
            if (FilterOverlay != null)
            {
                FilterOverlay.Dispose();
            }
            if (Renderer != null)
            {
                Renderer.Detach();
            }
            if (Network != null)
            {
                Network.Dispose();
            }
            if (Satellites != null)
            {
                Satellites.Dispose();
            }
            if (Antennas != null)
            {
                Antennas.Dispose();
            }

            Instance = null;
        }
Ejemplo n.º 4
0
        public void Start()
        {
            if (Instance != null)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            Satellites = new SatelliteManager();
            Antennas   = new AntennaManager();
            Network    = new NetworkManager();
            Renderer   = NetworkRenderer.CreateAndAttach();

            FilterOverlay       = new FilterOverlay();
            FocusOverlay        = new FocusOverlay();
            TimeQuadrantPatcher = new TimeQuadrantPatcher();

            TimeQuadrantPatcher.Patch();
            FlightUIPatcher.Patch();

            RTLog.Notify("RTCore loaded successfully.");

            foreach (var vessel in FlightGlobals.Vessels)
            {
                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
Ejemplo n.º 5
0
 private new void OnDestroy()
 {
     if (Instance != null)
     {
         FilterOverlay.OnExitMapView();
         FocusOverlay.OnExitMapView();
     }
     base.OnDestroy();
 }
Ejemplo n.º 6
0
        public new void Start()
        {
            base.Start();
            if (Instance == null)
            {
                return;
            }

            FilterOverlay.OnEnterMapView();
            FocusOverlay.OnEnterMapView();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Called by Unity engine during initialization phase.
        /// Only ever called once.
        /// </summary>
        public void Start()
        {
            // Destroy the Core instance if != null or if RemoteTech is disabled
            if (Instance != null || !RTSettings.Instance.RemoteTechEnabled)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            // disable KSP CommNet
            HighLogic.fetch.currentGame.Parameters.Difficulty.EnableCommNet = (RTSettings.Instance.CommNetEnabled = false);

            // add-ons
            KacAddon = new AddOns.KerbalAlarmClockAddon();

            // managers
            Satellites = new SatelliteManager();
            Antennas   = new AntennaManager();
            Network    = new NetworkManager();
            Renderer   = NetworkRenderer.CreateAndAttach();

            // overlays
            FilterOverlay     = new FilterOverlay();
            FocusOverlay      = new FocusOverlay();
            TimeWarpDecorator = new TimeWarpDecorator();

            // Handling new F2 GUI Hiding
            GameEvents.onShowUI.Add(UiOn);
            GameEvents.onHideUI.Add(UiOff);

            RTLog.Notify("RTCore {0} loaded successfully.", RTUtil.Version);

            // register vessels and antennas
            foreach (var vessel in FlightGlobals.Vessels)
            {
                // do not try to register vessel types that have no chance of being RT controlled.
                // includes: debris, SpaceObject, unknown, EVA and flag
                if ((vessel.vesselType <= VesselType.Unknown) || (vessel.vesselType >= VesselType.EVA))
                {
                    continue;
                }

                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
Ejemplo n.º 8
0
        public void OnDestroy()
        {
            if (FocusOverlay != null)
            {
                FocusOverlay.Dispose();
            }
            if (ManeuverNodeOverlay != null)
            {
                ManeuverNodeOverlay.Dispose();
            }
            if (FilterOverlay != null)
            {
                FilterOverlay.Dispose();
            }
            if (Renderer != null)
            {
                Renderer.Detach();
            }
            if (Network != null)
            {
                Network.Dispose();
            }
            if (Satellites != null)
            {
                Satellites.Dispose();
            }
            if (Antennas != null)
            {
                Antennas.Dispose();
            }

            // Remove GUI stuff
            GameEvents.onShowUI.Remove(UIOn);
            GameEvents.onHideUI.Remove(UIOff);

            // addons
            if (ctrlLockAddon != null)
            {
                ctrlLockAddon = null;
            }
            if (kacAddon != null)
            {
                kacAddon = null;
            }

            Instance = null;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Called by the Unity engine during the Decommissioning phase of the Engine.
        /// This is used to clean up everything before quiting.
        /// </summary>
        public void OnDestroy()
        {
            if (FocusOverlay != null)
            {
                FocusOverlay.Dispose();
            }
            if (ManeuverNodeOverlay != null)
            {
                ManeuverNodeOverlay.Dispose();
            }
            if (FilterOverlay != null)
            {
                FilterOverlay.Dispose();
            }
            if (Renderer != null)
            {
                Renderer.Detach();
            }
            if (Network != null)
            {
                Network.Dispose();
            }
            if (Satellites != null)
            {
                Satellites.Dispose();
            }
            if (Antennas != null)
            {
                Antennas.Dispose();
            }

            // Release all RT locks currently engaged
            ReleaseLocks();

            // Remove GUI stuff
            GameEvents.onShowUI.Remove(UiOn);
            GameEvents.onHideUI.Remove(UiOff);

            // add-ons
            if (KacAddon != null)
            {
                KacAddon = null;
            }

            Instance = null;
        }
Ejemplo n.º 10
0
        public void Start()
        {
            // Destroy the Core instance if != null or if Remotetech is disabled
            if (Instance != null || !RTSettings.Instance.RemoteTechEnabled)
            {
                Destroy(this);
                return;
            }

            Instance = this;

            ctrlLockAddon = new AddOns.ControlLockAddon();
            kacAddon      = new AddOns.KerbalAlarmClockAddon();

            Satellites = new SatelliteManager();
            Antennas   = new AntennaManager();
            Network    = new NetworkManager();
            Renderer   = NetworkRenderer.CreateAndAttach();

            FilterOverlay     = new FilterOverlay();
            FocusOverlay      = new FocusOverlay();
            TimeWarpDecorator = new TimeWarpDecorator();

            // Handling new F2 GUI Hiding
            GameEvents.onShowUI.Add(UIOn);
            GameEvents.onHideUI.Add(UIOff);

            FlightUIPatcher.Patch();

            RTLog.Notify("RTCore {0} loaded successfully.", RTUtil.Version);

            foreach (var vessel in FlightGlobals.Vessels)
            {
                Satellites.RegisterProto(vessel);
                Antennas.RegisterProtos(vessel);
            }
        }
Ejemplo n.º 11
0
 private new void OnDestroy()
 {
     FilterOverlay.OnExitMapView();
     FocusOverlay.OnExitMapView();
     base.OnDestroy();
 }
Ejemplo n.º 12
0
 public new void Start()
 {
     base.Start();
     FilterOverlay.OnEnterMapView();
     FocusOverlay.OnEnterMapView();
 }