예제 #1
0
        protected override void Start()
        {
            base.Start();
            if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
            {
                return;
            }
            Debug.Log($"[RACN UI] Start() in {HighLogic.LoadedScene}");
            configWindow        = gameObject.AddComponent <NetUIConfigurationWindow>();
            configWindow.parent = this;

            if (MapView.fetch is MapView map)
            {
                Texture2D defaultTex = GameDatabase.Instance.GetTexture(icon, false);
                foreach (RACommNetHome home in GameObject.FindObjectsOfType <RACommNetHome>())
                {
                    MapUI.GroundStationSiteNode gs = new MapUI.GroundStationSiteNode(home.Comm as RACommNode);
                    SiteNode  siteNode             = SiteNode.Spawn(gs);
                    Texture2D stationTexture       = (GameDatabase.Instance.GetTexture(home.icon, false) is Texture2D tex) ? tex : defaultTex;
                    siteNode.wayPoint.node.SetIcon(Sprite.Create(stationTexture, new Rect(0, 0, stationTexture.width, stationTexture.height), new Vector2(0.5f, 0.5f), 100f));
                    //                    MapView.fetch.siteNodes.Add(SiteNode.Spawn(gs));
                }

//                RAOrbitRenderer.ReplaceOrbitRenderers();
            }
            RATelemetryUpdate.Install();
        }
예제 #2
0
        public static void Install()
        {
            if (TelemetryUpdate.Instance is TelemetryUpdate tu)
            {
                SignalToolTipController tc = tu.gameObject.AddComponent <SignalToolTipController>();
                tc.Copy(tu.signal_tooltip);
                DestroyImmediate(tu.signal_tooltip);
                tu.signal_tooltip = tc;

                RATelemetryUpdate telem = tu.transform.parent.gameObject.AddComponent <RATelemetryUpdate>();
                telem.Copy(tu);
                DestroyImmediate(tu);
            }
        }
예제 #3
0
        protected override void Start()
        {
            base.Start();
            if (!(HighLogic.LoadedSceneIsFlight || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
            {
                return;
            }

            if (MapView.fetch is MapView)
            {
                Texture2D defaultTex = GameDatabase.Instance.GetTexture(icon, false);
                foreach (RACommNetHome home in FindObjectsOfType <RACommNetHome>())
                {
                    MapUI.GroundStationSiteNode gs = new MapUI.GroundStationSiteNode(home.Comm);
                    SiteNode  siteNode             = SiteNode.Spawn(gs);
                    Texture2D stationTexture       = (GameDatabase.Instance.GetTexture(home.icon, false) is Texture2D tex) ? tex : defaultTex;
                    siteNode.wayPoint.node.SetIcon(Sprite.Create(stationTexture, new Rect(0, 0, stationTexture.width, stationTexture.height), new Vector2(0.5f, 0.5f), 100f));
                    siteNode.wayPoint.node.OnUpdateVisible += home.OnUpdateVisible;
                }
            }
            RATelemetryUpdate.Install();
        }