void OnGUI()
 {
     if (enabled)               // don't do any work at all unless we're enabled
     {
         if (gui_enabled)       // don't create windows unless we're going to show them
         {
             GUI.skin = HighLogic.Skin;
             if (windowpos.x == 0)
             {
                 windowpos = new Rect(Screen.width / 2 - 250,
                                      Screen.height / 2 - 30, 0, 0);
             }
             string name = "Extraplanetary Launchpad";
             string ver  = ExSettings.GetVersion();
             windowpos = GUILayout.Window(GetInstanceID(),
                                          windowpos, WindowGUI,
                                          name + " " + ver,
                                          GUILayout.Width(500));
             if (windowpos.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
             {
                 InputLockManager.SetControlLock("EL_Settings_window_lock");
             }
             else
             {
                 InputLockManager.RemoveControlLock("EL_Settings_window_lock");
             }
         }
         else
         {
             InputLockManager.RemoveControlLock("EL_Settings_window_lock");
         }
     }
 }
Ejemplo n.º 2
0
        void OnGUI()
        {
            if (!showGUI || buildCost == null)
            {
                return;
            }

            if (winpos.x == 0 && winpos.y == 0)
            {
                winpos.x      = Screen.width / 2;
                winpos.y      = Screen.height / 2;
                winpos.width  = 300;
                winpos.height = 100;
            }
            string ver = ExSettings.GetVersion();

            winpos = GUILayout.Window(GetInstanceID(), winpos, InfoWindow,
                                      "Build Resources: " + ver,
                                      GUILayout.MinWidth(200));
            if (enabled && winpos.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y)))
            {
                InputLockManager.SetControlLock("EL_ShipInfo_window_lock");
            }
            else
            {
                InputLockManager.RemoveControlLock("EL_ShipInfo_window_lock");
            }
        }
Ejemplo n.º 3
0
 public void Awake()
 {
     if (ToolbarManager.Instance == null)
     {
         return;
     }
     ExSettingsButton             = ToolbarManager.Instance.add("ExtraplanetaryLaunchpads", "ExSettingsButton");
     ExSettingsButton.TexturePath = "ExtraplanetaryLaunchpads/Textures/icon_button";
     ExSettingsButton.ToolTip     = "EL Settings Window";
     ExSettingsButton.OnClick    += (e) => ExSettings.ToggleGUI();
 }
Ejemplo n.º 4
0
        void OnGUI()
        {
            if (CompatibilityChecker.IsWin64())
            {
                return;
            }
            GUI.skin = HighLogic.Skin;
            string name = "Extraplanetary Launchpad";
            string ver  = ExSettings.GetVersion();
            string sit  = control.builder.vessel.situation.ToString();

            windowpos = GUILayout.Window(GetInstanceID(),
                                         windowpos, WindowGUI,
                                         name + " " + ver + ": " + sit,
                                         GUILayout.Width(640));
            if (craftlist != null)
            {
                craftlist.OnGUI();
            }
        }