Exemplo n.º 1
0
 void OnGUI()
 {
     if (!styles_init)
     {
         GUIStyles.Init();
         styles_init = true;
     }
     if (ActiveVessel == null)
     {
         return;
     }
     if (!autopilot_module_lists.ContainsKey(ActiveVessel))
     {
         return;
     }
     if (!HighLogic.LoadedSceneIsFlight)
     {
         return;
     }
     GUIStyles.set_colors();
     applauncher.OnGUI();
     foreach (var pair in autopilot_module_lists[ActiveVessel])
     {
         pair.Value.OnGUI();
     }
     hotkeyManager.OnGUI();
     GUIStyles.reset_colors();
 }
Exemplo n.º 2
0
        private void mainMenuOpen()
        {
            // fade menu in if already open
            if (toolbar_menu != null)
            {
                toolbar_menu.fadeIn();
                return;
            }

            if (toolbar_menu_prefab == null)
            {
                toolbar_menu_prefab = prefabs.LoadAsset <GameObject> ("AtmosphereAutopilotMainMenu");
            }

            if (toolbar_menu_prefab == null || toolbar_menu_object != null)
            {
                return;
            }

            toolbar_menu_object = Instantiate(toolbar_menu_prefab, GetAnchor(), Quaternion.identity) as GameObject;
            if (toolbar_menu_object == null)
            {
                return;
            }

            toolbar_menu_object.transform.SetParent(MainCanvasUtil.MainCanvas.transform);
            toolbar_menu = toolbar_menu_object.GetComponent <UI.MainMenuGUI> ();
            if (toolbar_menu != null)
            {
                toolbar_menu.setController(new NeoGUIController(this));
            }
            GUIStyles.Process(toolbar_menu_object);
        }