Ejemplo n.º 1
0
        public void DrawWindow(int windowID)
        {
            try
            {
                GUILayout.BeginVertical();
                try {
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button("Flight Corridor", currentTab == tabs.FlightCorridor ? pressedButton : HighLogic.Skin.button))
                    {
                        currentTab = tabs.FlightCorridor;
                    }
                    if (GUILayout.Button("ARM Actions", currentTab == tabs.ArmActions ? pressedButton : HighLogic.Skin.button))
                    {
                        currentTab = tabs.ArmActions;
                    }
                    if (GUILayout.Button("Settings", currentTab == tabs.Settings ? pressedButton : HighLogic.Skin.button))
                    {
                        currentTab = tabs.Settings;
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal();
                    GUIUtils.SimpleLabel("State", FlightRange.GetRangeStateText(rangeSafetyInstance.flightRange.State, rangeSafetyInstance.flightCorridor.Status));
                    GUILayout.EndHorizontal();

                    switch (currentTab)
                    {
                    case tabs.FlightCorridor:
                        FlightCorridorTab();
                        break;

                    case tabs.ArmActions:
                        ArmActionsTab();
                        break;

                    case tabs.Settings:
                        SettingsTab();
                        break;
                    }
                }
                finally
                {
                    GUILayout.FlexibleSpace();
                    GUILayout.EndVertical();
                }
            }
            finally
            {
                GUI.DragWindow();
                rangeSafetyInstance.settings.windowX = windowPos.x;
                rangeSafetyInstance.settings.windowY = windowPos.y;
            }
        }
Ejemplo n.º 2
0
 protected void Start()
 {
     try
     {
         settings       = Settings.InstantiateFromConfig();
         flightCorridor = FlightCorridorBase.InstantiateFromConfig();
         flightCorridor.SystemSettings = settings;
         flightRange = new FlightRange();
         flightRange.Initialize(this);
     }
     catch (Exception ex)
     {
         Debug.LogException(ex);
     }
 }