public override void OnDestroy() { base.OnDestroy(); clear_fields(); TCAAppToolbar.AttachTCA(null); GameEvents.onVesselChange.Remove(onVesselChange); GameEvents.onVesselDestroy.Remove(onVesselDestroy); }
bool init() { clear_fields(); ClearStatus(); TCAAppToolbar.AttachTCA(null); TCA = ModuleTCA.AvailableTCA(vessel); if (TCA == null || CFG == null) { return(false); } ActiveVesselTCA = ModuleTCA.AvailableTCA(FlightGlobals.ActiveVessel); HaveRemoteControl = ActiveVesselTCA != null && ActiveVesselTCA.GetModule <SquadControl>() != null; RemoteControl = ActiveVesselTCA != TCA; ShowInstance(CFG.GUIVisible); ModulesGraph.SetCFG(CFG); TCAAppToolbar.AttachTCA(TCA); create_fields(); if (ADV != null) { ADV.UpdateNamedConfigs(); } return(true); }