public void CreateButton() { ButtonNeeded = Proximity.IsRelevant(); if (ButtonNeeded) { MakeButton(); } else if (toolbarControl != null) { toolbarControl.buttonActive = false; } }
public void CreateButton() { //print("@@@CreateButton - CreateButtons called"); buttonNeeded = Proximity.IsRelevant(); if (buttonNeeded) { MakeButton(); } else { ApplicationLauncher.Instance.RemoveModApplication(stockToolbarBtn); } }
void ToggleOnRightClick() { if (FlightGlobals.ActiveVessel != null) { List <Proximity> prox = FlightGlobals.ActiveVessel.FindPartModulesImplementing <Proximity>(); if (prox != null && prox.Count > 0) { Proximity p = prox.FirstOrDefault(); if (p != null) { p.ToggleSystemOn(); } return; } } }