/// <summary> /// Destroys theToolbarButtonWrapper object /// </summary> /// <param name="btnToDestroy">Object to Destroy</param> internal void DestroyToolbarButton(IButton btnToDestroy) { if (btnToDestroy != null) { LogFormatted("Destroying Toolbar Button"); btnToDestroy.Destroy(); } btnToDestroy = null; }
// ReSharper disable once MemberCanBeMadeStatic.Local -> static does not work with GameEvents private void OnSceneChange(GameEvents.FromToAction <GameScenes, GameScenes> fromToScenes) { FARLogger.Info("check scene"); if (fromToScenes.to == GameScenes.SPACECENTER) { if (!FARDebugValues.useBlizzyToolbar) { return; } if (FARDebugButtonBlizzy != null) { return; } FARDebugButtonBlizzy = ToolbarManager.Instance.add("FerramAerospaceResearch", "FARDebugButtonBlizzy"); FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy"; FARDebugButtonBlizzy.ToolTip = "FAR Debug Options"; FARDebugButtonBlizzy.OnClick += e => debugMenu = !debugMenu; } else { FARDebugButtonBlizzy?.Destroy(); } }
//Vessel state handlers internal void OnDestroy() { //Debug.Log("[RosterManager]: RosterManagerAddon.OnDestroy"); try { if (RMSettings.Loaded) { try { RMSettings.SaveSettings(); } catch { // Do nothing. } } // Handle Toolbars if (_rmRosterBlizzy == null) { if (_rmRosterStock != null) { ApplicationLauncher.Instance.RemoveModApplication(_rmRosterStock); _rmRosterStock = null; } if (_rmRosterStock == null) { // Remove the stock toolbar button launcher handler GameEvents.onGUIApplicationLauncherReady.Remove(OnGuiAppLauncherReady); } } else { _rmRosterBlizzy?.Destroy(); } //Reset Roster Window data WindowRoster.DisplayMode = WindowRoster.DisplayModes.None; WindowRoster.SelectedKerbal = null; WindowRoster.ToolTip = ""; //Settings.ShowRoster = false; } catch (Exception ex) { RmUtils.LogMessage("Error in: RosterManagerAddon.OnDestroy. " + ex, "Error", true); } }
private void DestroyAppIcons() { if (_blizzyButton == null) { if (_stockButton != null) { ApplicationLauncher.Instance.RemoveModApplication(_stockButton); _stockButton = null; } if (_stockButton == null) { // Remove the Stock toolbar button GameEvents.onGUIApplicationLauncherReady.Remove(OnGuiAppLauncherReady); } } else { _blizzyButton?.Destroy(); } }
internal void OnDestroy() { b.Destroy(); NavUtilLib.GlobalVariables.Settings.hsiState = false; //thanks to Virindi }
/// <summary> Destroys the blizzy toolbar button if it exists. </summary> private static void DestroyBlizzyToolbarButton() { blizzy_toolbar_button?.Destroy(); blizzy_toolbar_button = null; }
/// <summary> /// Destroys theToolbarButtonWrapper object /// </summary> /// <param name="btnToDestroy">Object to Destroy</param> static void DestroyToolbarButton(IButton btnToDestroy) { if (btnToDestroy != null) { Log.Info("Destroying Toolbar Button"); btnToDestroy.Destroy(); } btnToDestroy = null; }
private void OnDestroy() { buttonDOSettings.Destroy(); }
void OnDestroy() { ExEditorButton.Destroy(); }
public void Destroy() { _toolbarButton?.Destroy(); }
private void DebugAndDataTab(GUIStyle thisStyle) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); GUILayout.Label("Debug / Cheat Options"); FARDebugValues.allowStructuralFailures = GUILayout.Toggle(FARDebugValues.allowStructuralFailures, "Allow Aero-structural Failures", thisStyle); GUILayout.Label("Editor GUI Graph Colors"); Color tmpColor = GUIColors.Instance[0]; ChangeColor("Cl", ref tmpColor, ref cLTexture); GUIColors.Instance[0] = tmpColor; tmpColor = GUIColors.Instance[1]; ChangeColor("Cd", ref tmpColor, ref cDTexture); GUIColors.Instance[1] = tmpColor; tmpColor = GUIColors.Instance[2]; ChangeColor("Cm", ref tmpColor, ref cMTexture); GUIColors.Instance[2] = tmpColor; tmpColor = GUIColors.Instance[3]; ChangeColor("L_D", ref tmpColor, ref l_DTexture); GUIColors.Instance[3] = tmpColor; FARActionGroupConfiguration.DrawGUI(); GUILayout.Label("Other Options"); // DaMichel: put it above the toolbar toggle FARDebugValues.aeroFailureExplosions = GUILayout.Toggle(FARDebugValues.aeroFailureExplosions, "Aero Failures Create Explosions", thisStyle); FARDebugValues.showMomentArrows = GUILayout.Toggle(FARDebugValues.showMomentArrows, "Show Torque Arrows in Aero Overlay", thisStyle); if (ToolbarManager.ToolbarAvailable) { FARDebugValues.useBlizzyToolbar = GUILayout.Toggle(FARDebugValues.useBlizzyToolbar, "Use Blizzy78 Toolbar instead of Stock AppManager", thisStyle); bool tmp = FARDebugValues.useBlizzyToolbar; if (tmp != FARDebugValues.useBlizzyToolbar) { if (FARDebugButtonStock != null) { ApplicationLauncher.Instance.RemoveModApplication(FARDebugButtonStock); } if (FARDebugButtonBlizzy != null) { FARDebugButtonBlizzy.Destroy(); } if (FARDebugValues.useBlizzyToolbar) { FARDebugButtonBlizzy = ToolbarManager.Instance.add("ferram4", "FARDebugButtonBlizzy"); FARDebugButtonBlizzy.TexturePath = "FerramAerospaceResearch/Textures/icon_button_blizzy"; FARDebugButtonBlizzy.ToolTip = "FAR Debug Options"; FARDebugButtonBlizzy.OnClick += (e) => debugMenu = !debugMenu; } else { GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady); } } } GUILayout.EndVertical(); GUILayout.BeginVertical(); FARSettingsScenarioModule.Instance.DisplaySelection(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
public void Destroy() { wrapped.Destroy(); }
/// <summary> /// Normal cleanup /// </summary> void OnDestroy() { //Log.Verbose("Destroying BlizzyInterface"); button.Destroy(); }
private static void ClearBlizzyToolbarButton() { blizzyFlightGUIButton.Destroy(); blizzyFlightGUIButton = null; }
internal void OnDestroy() { OrbLogButton.Destroy(); }
public void OnDestroy() { button_mega.Destroy(); button_thermal.Destroy(); }
void OnDestroy() { SaveConfigs(); FAREditorButton.Destroy(); }
internal void Destroy() { if (!isAvailable) { return; } if (Button != null) { Button.Destroy(); Button = null; } if (ButtonConf != null) { ButtonConf.Destroy(); ButtonConf = null; } if (ButtonMain != null) { ButtonMain.Destroy(); ButtonMain = null; } if (ButtonSett != null) { ButtonSett.Destroy(); ButtonSett = null; } if (ButtonSC != null) { ButtonSC.Destroy(); ButtonSC = null; } if (ButtonVAB != null) { ButtonVAB.Destroy(); ButtonVAB = null; } if (ButtonSPH != null) { ButtonSPH.Destroy(); ButtonSPH = null; } if (ButtonTS != null) { ButtonTS.Destroy(); ButtonTS = null; } if (ButtonMI != null) { ButtonMI.Destroy(); ButtonMI = null; } if (ButtonAstr != null) { ButtonAstr.Destroy(); ButtonAstr = null; } if (ButtonAdmi != null) { ButtonAdmi.Destroy(); ButtonAdmi = null; } if (ButtonRnD != null) { ButtonRnD.Destroy(); ButtonRnD = null; } if (ButtonRv != null) { ButtonRv.Destroy(); ButtonRv = null; } if (ButtonRvED != null) { ButtonRvED.Destroy(); ButtonRvED = null; } if (ButtonRvSC != null) { ButtonRvSC.Destroy(); ButtonRvSC = null; } if (ButtonRc != null) { ButtonRc.Destroy(); ButtonRc = null; } if (ButtonLves != null) { ButtonLves.Destroy(); ButtonLves = null; } StopEach(); QuickGoTo.Log("Destroy", "QBlizzyToolbar"); }