Exemplo n.º 1
0
        internal override void Awake()
        {
            base.Awake();

            WindTunnelSettings.InitializeSettings();

            Threading.ThreadPool.Start(-1);

            if (Instance)
            {
                Destroy(Instance);
            }
            Instance = this;

            icon.LoadImage(System.IO.File.ReadAllBytes(texPath + iconPath_off));
            icon_on.LoadImage(System.IO.File.ReadAllBytes(texPath + iconPath));
            icon_blizzy.LoadImage(System.IO.File.ReadAllBytes(texPath + iconPath_blizzy_off));
            icon_blizzy_on.LoadImage(System.IO.File.ReadAllBytes(texPath + iconPath_blizzy));

            GameEvents.onEditorShipModified.Add(OnEditorShipModified);
            if (!ActivateBlizzyToolBar())
            {
                //log.debug("Registering GameEvents.");
                appLauncherEventSet = true;
                GameEvents.onGUIApplicationLauncherReady.Add(OnGuiApplicationLauncherReady);
            }
            guiId = GUIUtility.GetControlID(FocusType.Passive);

            window            = AddComponent <WindTunnelWindow>();
            window.WindowRect = new Rect(150, 50, 100, 100); //750, 600
            window.Parent     = this;
            window.Mach       = WindTunnelSettings.DefaultToMach;
            window.Minimized  = WindTunnelSettings.StartMinimized;
        }
Exemplo n.º 2
0
        internal override void Awake()
        {
            base.Awake();

            if (Instance)
            {
                Destroy(Instance);
            }
            Instance = this;

            // Fetch Celestial Bodies per TransferWindowPlanner method:
            cbStar = FlightGlobals.Bodies.FirstOrDefault(x => x.referenceBody == x.referenceBody);
            BodyParseChildren(cbStar);
            // Filter to only include planets with Atmospheres
            lstPlanets.RemoveAll(x => x.CB.atmosphere != true);

            int planetIndex = lstPlanets.FindIndex(x => x.CB == FlightGlobals.GetHomeBody());

            body = lstPlanets[planetIndex].CB;

            ddlPlanet = new DropDownList(lstPlanets.Select(p => p.NameFormatted), planetIndex, this);
            ddlPlanet.OnSelectionChanged += OnPlanetSelected;
            ddlManager.AddDDL(ddlPlanet);

            GameEvents.onEditorLoad.Add(OnVesselLoaded);
            GameEvents.onEditorNewShipDialogDismiss.Add(OnNewVessel);
            GameEvents.onEditorPodPicked.Add(OnRootChanged);
        }