void OnClick()
 {
     if (button != null)
     {
         MasterSwitch.Toggle();
         SetTexture();
     }
 }
 void OnRightClick()
 {
     if (button != null)
     {
         MasterSwitch.ToggleRepeat();
         SetTexture();
     }
 }
 public void Destroy()
 {
     MasterSwitch.Disable();
     GameEvents.onGUIApplicationLauncherReady.Remove(Add);
     GameEvents.onGUIApplicationLauncherUnreadifying.Remove(Destroy);
     if (button != null)
     {
         button.onRightClick -= OnRightClick;
         ApplicationLauncher.Instance.RemoveModApplication(button);
         button = null;
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Resets the entire logic state machine and the UI to be completely idle/disabled.
        /// </summary>
        public void Reset()
        {
            bool redrawRequired = MasterSwitch.IsEnabled;

            LastActiveVesselPersistentId = null;
            ResetLogic();
            MasterSwitch.Disable();
            if (redrawRequired)
            {
                RedrawAction?.Invoke();
            }
        }