Ejemplo n.º 1
0
 public void ToggleBVController()
 {
     shutdown = !shutdown;
     Events["ToggleBVController"].guiName = (!shutdown ? Localizer.Format("#LOC_BV_ContextMenu_Shutdown") : Localizer.Format("#LOC_BV_ContextMenu_Activate"));
     if (!HighLogic.LoadedSceneIsEditor)
     {
         Fields["vesselType"].guiActive     = !shutdown;
         Fields["rotationVector"].guiActive = !shutdown;
         Events["BVControlPanel"].guiActive = !shutdown;
         if (shutdown)
         {
             if (active)
             {
                 BVController controller = BonVoyage.Instance.GetControllerOfVessel(vessel);
                 if (controller != null)
                 {
                     controller.Deactivate();
                 }
             }
         }
         BonVoyage.Instance.SetShutdownState(vessel.id, shutdown);
     }
     else
     {
         Fields["vesselType"].guiActiveEditor = !shutdown;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Go button was clicked
        /// </summary>
        internal void GoButtonClicked()
        {
            if (currentController != null)
            {
                if (!currentController.CheckConnection())
                {
                    return;
                }

                if (!controllerActive)
                {
                    controllerActive = currentController.Activate();
                    if (!controllerActive) // Refresh after uncomplete activation - show results of a system check
                    {
                        RefreshStatsListLayout();
                    }
                }
                else
                {
                    controllerActive = currentController.Deactivate();
                    BonVoyage.Instance.ResetWindows();
                }
            }
            else
            {
                ScreenMessages.PostScreenMessage(Localizer.Format("#LOC_BV_Warning_ControllerNotValid", 5f)).color = Color.yellow;
            }
        }