Ejemplo n.º 1
0
 /// <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();
     }
 }
Ejemplo n.º 3
0
        //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);
            }
        }
Ejemplo n.º 4
0
        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();
            }
        }
Ejemplo n.º 5
0
    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;
 }
Ejemplo n.º 8
0
 private void OnDestroy()
 {
     buttonDOSettings.Destroy();
 }
Ejemplo n.º 9
0
 void OnDestroy()
 {
     ExEditorButton.Destroy();
 }
 public void Destroy()
 {
     _toolbarButton?.Destroy();
 }
Ejemplo n.º 11
0
        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();
        }
Ejemplo n.º 12
0
 public void Destroy()
 {
     wrapped.Destroy();
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Normal cleanup
 /// </summary>
 void OnDestroy()
 {
     //Log.Verbose("Destroying BlizzyInterface");
     button.Destroy();
 }
Ejemplo n.º 14
0
 private static void ClearBlizzyToolbarButton()
 {
     blizzyFlightGUIButton.Destroy();
     blizzyFlightGUIButton = null;
 }
Ejemplo n.º 15
0
 internal void OnDestroy()
 {
     OrbLogButton.Destroy();
 }
Ejemplo n.º 16
0
 public void OnDestroy()
 {
     button_mega.Destroy();
     button_thermal.Destroy();
 }
Ejemplo n.º 17
0
 void OnDestroy()
 {
     SaveConfigs();
     FAREditorButton.Destroy();
 }
Ejemplo n.º 18
0
 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");
 }