예제 #1
0
        public void SetupMainToolbarButton()
        {
            if (!ToolbarManager.ToolbarAvailable)
            {
                return;
            }

            if (menuButton == null)
            {
                menuButton             = ToolbarManager.Instance.add("MechJeb2", "MechJeb2MenuButton");
                menuButton.ToolTip     = "MechJeb2";
                menuButton.TexturePath = "MechJeb2/Icons/MJ2";
                menuButton.OnClick    += (b) =>
                {
                    MechJebModuleMenu mod = FlightGlobals.ActiveVessel.GetMasterMechJeb().GetComputerModule <MechJebModuleMenu>();
                    mod.ShowHideWindow();
                    //print("Change MechJebModuleMenu ");
                };
            }
            menuButton.Visible = true;
        }
예제 #2
0
        public void ShowHideMasterWindow()
        {
            MechJebModuleMenu mod = FlightGlobals.ActiveVessel.GetMasterMechJeb().GetComputerModule <MechJebModuleMenu>();

            mod.ShowHideWindow();
        }