Exemplo n.º 1
0
        public void OnGUI()
        {
            if (vessel == null || !vessel.isActiveVessel)
            {
                vessel = FlightGlobals.ActiveVessel;
                if (vessel != null)
                {
                    flightSys = vessel.gameObject.GetComponent <SolverFlightSys>();
                }
                else
                {
                    flightSys = null;
                }
            }

            if (vessel == null || (vessel.Parts.Count == 0) || flightSys == null || !ShowFlightGUIWindow || !ShowAllUIFlight)
            {
                return;
            }

            if (!GUIUtil.StylesInitialized)
            {
                GUIUtil.SetupStyles();
            }

            FlightWindowPos = GUILayout.Window(GUIUtil.FlightWindowID, FlightWindowPos, FlightWindowGUI, "Engines GUI", GUILayout.MinWidth(150));

            FlightGUISettings.OnSettingsWindowGUI();
            GUIUnitsSettings.OnUnitsSettingsWindowGUI();
        }
Exemplo n.º 2
0
        public void LoadSettingsFromConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <EnginesFlightGUI>();
            config.load();

            FlightWindowPos = config.GetValue("flightWindowPos", new Rect());
            //FlightGUI.ShowFlightGUIWindow = config.GetValue("showFlightWindow", false);

            FlightGUISettings.LoadSettings(ref config);
            GUIUnitsSettings.LoadSettings(ref config);
        }
Exemplo n.º 3
0
        public void SaveSettingsToConfig()
        {
            KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType <EnginesFlightGUI>();
            //config.SetValue("showFlightWindow", FlightGUI.ShowFlightGUIWindow);

            config.SetValue("flightWindowPos", FlightWindowPos);

            FlightGUISettings.SaveSettings(ref config);
            GUIUnitsSettings.SaveSettings(ref config);

            config.save();
        }