Exemplo n.º 1
0
        internal static void Display(int windowId)
        {
            // Reset Tooltip active flag...
            Rect rect = new Rect();

            ToolTipActive = false;

            rect = new Rect(371, 4, 16, 16);
            if (GUI.Button(rect, new GUIContent("", "Close Window")))
            {
                ToolTip = "";
                WindowSettings.ShowWindow = false;
            }
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Position, GUI.tooltip, ref ToolTipActive, 0, 0);
            }

            // Store settings in case we cancel later...
            RMSettings.StoreTempSettings();

            GUILayout.BeginVertical();
            ScrollViewerPosition = GUILayout.BeginScrollView(ScrollViewerPosition, GUILayout.Height(280), GUILayout.Width(375));
            GUILayout.BeginVertical();

            DisplayOptions();

            DisplayHighlighting();

            DisplayToolTips();

            DisplayConfiguration();

            GUILayout.EndVertical();
            GUILayout.EndScrollView();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Save"))
            {
                RMSettings.SaveSettings();
                WindowSettings.ShowWindow = false;
            }
            if (GUILayout.Button("Cancel"))
            {
                // We've canclled, so restore original settings.
                RMSettings.RestoreTempSettings();
                WindowSettings.ShowWindow = false;
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();

            GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        //Vessel state handlers
        internal void OnDestroy()
        {
            //Debug.Log("[RosterManager]:  RosterManagerAddon.OnDestroy");
            try
            {
                if (RMSettings.Loaded)
                {
                    RMSettings.SaveSettings();
                }

                // Handle Toolbars
                if (RMRoster_Blizzy == null)
                {
                    if (RMRoster_Stock != null)
                    {
                        ApplicationLauncher.Instance.RemoveModApplication(RMRoster_Stock);
                        RMRoster_Stock = null;
                    }
                    if (RMRoster_Stock == null)
                    {
                        // Remove the stock toolbar button launcher handler
                        GameEvents.onGUIApplicationLauncherReady.Remove(OnGUIAppLauncherReady);
                    }
                }
                else
                {
                    if (RMRoster_Blizzy != null)
                    {
                        RMRoster_Blizzy.Destroy();
                    }
                }
                //Reset Roster Window data
                WindowRoster.OnCreate       = false;
                WindowRoster.SelectedKerbal = null;
                WindowRoster.ToolTip        = "";
                //Settings.ShowRoster = false;
            }
            catch (Exception ex)
            {
                Utilities.LogMessage("Error in:  RosterManagerAddon.OnDestroy.  " + ex.ToString(), "Error", true);
            }
        }