Esempio n. 1
0
        private void SettingsWindow(int windowId)
        {
            GUILayout.Label(Localizer.Format("FARFlightSettingsLabel"));
            settingsWindow.GUIDropDownDisplay();
            int selection = settingsWindow.ActiveSelection;

            switch (selection)
            {
            case 0:
                if (_flightDataGUI.SettingsDisplay())
                {
                    dataGuiRect.height = 0;
                }
                break;

            case 1:
                _stabilityAugmentation.SettingsDisplay();
                break;

            case 2:
                airSpeedGUI.AirSpeedSettings();
                break;

            case 3:
                AeroVizGUI.SettingsDisplay();
                break;
            }

            GUI.DragWindow();
        }
Esempio n. 2
0
 public void SaveData()
 {
     if (_vessel != FlightGlobals.ActiveVessel)
     {
         return;
     }
     SaveConfigs();
     airSpeedGUI?.SaveSettings();
     _stabilityAugmentation?.SaveSettings();
     _flightDataGUI?.SaveSettings();
     AeroVizGUI?.SaveSettings();
 }
        private void OnDestroy()
        {
            FlightGUIDrawer.SetGUIActive(this, false);
            GameEvents.onShowUI.Remove(ShowUI);
            GameEvents.onHideUI.Remove(HideUI);
            SaveConfigs();
            if (_vessel)
            {
                vesselFlightGUI.Remove(_vessel);
            }
            _physicsCalcs = null;

            _flightDataGUI?.SaveSettings();
            _flightDataGUI = null;

            _stabilityAugmentation?.SaveAndDestroy();
            _stabilityAugmentation = null;

            airSpeedGUI?.SaveSettings();
            airSpeedGUI = null;

            AeroVizGUI?.SaveSettings();

            if (flightDataLogger)
            {
                flightDataLogger.StopLogging();
                flightDataLogger = null;
            }

            _flightStatusGUI = null;
            settingsWindow   = null;

            activeFlightGUICount--;

            if (activeFlightGUICount <= 0)
            {
                activeFlightGUICount = 0;
                if (blizzyFlightGUIButton != null)
                {
                    ClearBlizzyToolbarButton();
                }
            }

            savedShowGUI = showGUI;
        }