Beispiel #1
0
        private static void DisplayRealism()
        {
            Rect rect = new Rect();

            GUI.enabled = true;
            GUILayout.Label("-------------------------------------------------------------------", GUILayout.Height(10));
            if (!Settings.LockSettings)
            {
                GUILayout.Label("Realism Settings / Options", GUILayout.Height(10));
            }
            else
            {
                GUILayout.Label("Realism Settings / Options  (Locked.  Unlock in Config file)", GUILayout.Height(10));
            }
            GUILayout.Label("-------------------------------------------------------------------", GUILayout.Height(16));

            bool isEnabled = (!Settings.LockSettings);

            // Realism Mode
            GUI.enabled = isEnabled;
            GUIContent guiLabel = new GUIContent("Enable Realism Mode", "Turns on/off Realism Mode.\r\nWhen ON, causes changes in the interface and limits\r\nyour freedom to things that would not be 'Realistic'.\r\nWhen Off, Allows Fills, Dumps, Repeating Science, instantaneous Xfers, Crew Xfers anywwhere, etc.");

            Settings.RealismMode = GUILayout.Toggle(Settings.RealismMode, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }

            // EnableCrew Mode
            GUI.enabled = isEnabled;
            GUILayout.BeginHorizontal();
            guiLabel            = new GUIContent("Enable Crew Xfers", "Turns on/off Crew transfers.\r\nWhen ON, The Crew option will appear in your resource list.\r\nWhen Off, Crew transfers are not possible.");
            Settings.EnableCrew = GUILayout.Toggle(Settings.EnableCrew, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }

            GUILayout.EndHorizontal();

            if (!Settings.EnableCrew && HighLogic.LoadedSceneIsFlight)
            {
                if (SMAddon.smController.SelectedResource == "Crew")
                {
                    // Clear Resource selection.
                    SMAddon.smController.SelectedResource = null;
                    Settings.ShowTransferWindow           = false;
                }
            }

            // Enable stock Crew Xfer Override
            GUI.enabled = isEnabled;
            GUILayout.BeginHorizontal();
            guiLabel = new GUIContent("Override Stock Crew Xfers", "Turns on/off Overriding the stock Crew Transfer mechanism with the SM style.\r\nWhen ON (along with Realism Mode),\r\nstock crew transfers (Tweakable) will behave like SM style transfers.\r\nWhen Off (or Realism is off), Stock Crew transfers behave normally.");
            GUILayout.Space(20);
            Settings.OverrideStockCrewXfer = GUILayout.Toggle(Settings.OverrideStockCrewXfer, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }

            GUILayout.EndHorizontal();

            // EnableCLS Mode
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            if (!Settings.EnableCrew || !Settings.CLSInstalled)
            {
                GUI.enabled = false;
            }
            else
            {
                GUI.enabled = isEnabled;
            }
            guiLabel           = new GUIContent("Enable CLS  (Connected Living Spaces)", "Turns on/off Connected Living space support.\r\nWhen on, Crew can only be xfered to a part in the same 'Living Space'.\r\nWhen Off, Crew transfers are possible to any part that can hold a kerbal.");
            Settings.EnableCLS = GUILayout.Toggle(Settings.EnableCLS, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            if (Settings.EnableCLS != Settings.prevEnableCLS && HighLogic.LoadedSceneIsFlight)
            {
                if (!Settings.EnableCLS)
                {
                    SMAddon.HighlightCLSVessel(false, true);
                }
                else if (SMAddon.smController.SelectedResource == "Crew")
                {
                    // Update spaces and reassign the resource to observe new settings.
                    SMAddon.UpdateCLSSpaces();
                    SMAddon.smController.SelectedResource = "Crew";
                }
            }

            // EnableScience Mode
            GUILayout.BeginHorizontal();
            GUI.enabled            = isEnabled;
            guiLabel               = new GUIContent("Enable Science Xfers", "Turns on/off Science Xfers.\r\nWhen on, Science transfers are possible and show up in the Resource list.\r\nWhen Off, Science transfers will not appear in the resource list.");
            Settings.EnableScience = GUILayout.Toggle(Settings.EnableScience, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            if (!Settings.EnableScience && HighLogic.LoadedSceneIsFlight)
            {
                // Clear Resource selection.
                if (SMAddon.smController.SelectedResource == "Science")
                {
                    SMAddon.smController.SelectedResource = null;
                }
            }

            // EnableResources Mode
            GUILayout.BeginHorizontal();
            GUI.enabled = isEnabled;
            guiLabel    = new GUIContent("Enable Resource Xfers", "Turns on/off Resource Xfers.\r\nWhen on, Resource transfers are possible and show up in the Resource list.\r\nWhen Off, Resources (fuel, monoprpellent, etc) will not appear in the resource list.");
            Settings.EnableResources = GUILayout.Toggle(Settings.EnableResources, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            if (!Settings.EnableResources && HighLogic.LoadedSceneIsFlight)
            {
                // Clear Resource selection.
                if (SMAddon.smController.SelectedResource == "Resources")
                {
                    SMAddon.smController.SelectedResource = null;
                }
            }

            // Set Gui.enabled for child settings to resources...
            if (Settings.EnableResources)
            {
                GUI.enabled = isEnabled;
            }
            else
            {
                GUI.enabled = false;
            }

            // EnablePFResources Mode
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            guiLabel = new GUIContent("Enable Resources in Pre-Flight", "Turns on/off Fill and Empty Resources when in preflight.\r\nWhen on, Resource Fill and Dump resources vessel wide are possible and show up in the Resource list.\r\nWhen Off, Fill and Dump Resources vessel wide will not appear in the resource list.");
            Settings.EnablePFResources = GUILayout.Toggle(Settings.EnablePFResources, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            // EnableXferCost Mode
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            guiLabel = new GUIContent("Enable Resource Xfer Costs", "Turns on/off ElectricCharge cost forResource Xfers.\r\nWhen on, Resource transfers will cost ElectricCharge.\r\nWhen Off, Resources Xfers are Free (original SM behavior).");
            Settings.EnableXferCost = GUILayout.Toggle(Settings.EnableXferCost, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            // Resource Xfer EC cost
            float newCost = 0;

            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            guiLabel = new GUIContent("Resource Flow Cost:", "Sets the Electrical cost of resource Xfers when Realism Mode is on.\r\nThe higher the number the more ElectricCharge used.");
            GUILayout.Label(guiLabel, GUILayout.Width(130), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }

            // Lets parse the string to allow decimal points.
            strFlowCost = Settings.FlowCost.ToString();
            // add the decimal point if it was typed.
            strFlowCost = Utilities.GetStringDecimal(strFlowCost);
            // add the zero if it was typed.
            strFlowCost = Utilities.GetStringZero(strFlowCost);

            strFlowCost = GUILayout.TextField(strFlowCost, 20, GUILayout.Height(20), GUILayout.Width(80));
            guiLabel    = new GUIContent("EC/Unit", "Sets the Electrical cost of resource Xfers when Realism Mode is on.\r\nThe higher the number the more ElectricCharge used.");
            GUILayout.Label(guiLabel, GUILayout.Width(80), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            // update decimal bool
            Utilities.SetStringDecimal(strFlowCost);
            //update zero bool
            Utilities.SetStringZero(strFlowCost);

            if (float.TryParse(strFlowCost, out newCost))
            {
                Settings.FlowCost = newCost;
            }

            // create xfer Flow Rate slider;
            // Lets parse the string to allow decimal points.
            string strFlowRate    = Settings.FlowRate.ToString();
            string strMinFlowRate = Settings.MinFlowRate.ToString();
            string strMaxFlowRate = Settings.MaxFlowRate.ToString();
            string strMaxFlowTime = Settings.MaxFlowTimeSec.ToString();

            float newRate = 0;

            // Resource Flow Rate
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            guiLabel = new GUIContent("Resource Flow Rate:", "Sets the rate that resources Xfer when Realism Mode is on.\r\nThe higher the number the faster resources move.\r\nYou can also use the slider below to change this value");
            GUILayout.Label(guiLabel, GUILayout.Width(130), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            strFlowRate = GUILayout.TextField(strFlowRate, 20, GUILayout.Height(20), GUILayout.Width(80));
            guiLabel    = new GUIContent("Units/Sec", "Sets the rate that resources Xfer when Realism Mode is on.\r\nThe higher the number the faster resources move.\r\nYou can also use the slider below to change this value");
            GUILayout.Label(guiLabel, GUILayout.Width(80), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();
            if (float.TryParse(strFlowRate, out newRate))
            {
                Settings.FlowRate = (int)newRate;
            }

            // Resource Flow rate Slider
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            GUILayout.Label(Settings.MinFlowRate.ToString(), GUILayout.Width(10), GUILayout.Height(20));
            Settings.FlowRate = (double)GUILayout.HorizontalSlider((float)Settings.FlowRate, (float)Settings.MinFlowRate, (float)Settings.MaxFlowRate, GUILayout.Width(240), GUILayout.Height(20));
            guiLabel          = new GUIContent(Settings.MaxFlowRate.ToString(), "Slide control to change the Resource Flow Rate shown above.");
            GUILayout.Label(guiLabel, GUILayout.Width(40), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();

            // Min Flow Rate for Slider
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            guiLabel = new GUIContent(" - Min Flow Rate:", "Sets the lowest range (left side) on the Flow rate Slider control.");
            GUILayout.Label(guiLabel, GUILayout.Width(130), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            strMinFlowRate = GUILayout.TextField(strMinFlowRate, 20, GUILayout.Height(20), GUILayout.Width(80));
            guiLabel       = new GUIContent("Units/Sec", "Sets the lowest range (left side) on the Flow rate Slider control.");
            GUILayout.Label(guiLabel, GUILayout.Width(80), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();
            if (float.TryParse(strMinFlowRate, out newRate))
            {
                Settings.MinFlowRate = (int)newRate;
            }

            // Max Flow Rate for Slider
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            guiLabel = new GUIContent(" - Max Flow Rate:", "Sets the highest range (right side) on the Flow rate Slider control.");
            GUILayout.Label(guiLabel, GUILayout.Width(130), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            strMaxFlowRate = GUILayout.TextField(strMaxFlowRate, 20, GUILayout.Height(20), GUILayout.Width(80));
            guiLabel       = new GUIContent("Units/Sec", "Sets the highest range (right side) on the Flow rate Slider control.");
            GUILayout.Label(guiLabel, GUILayout.Width(80), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();
            if (float.TryParse(strMaxFlowRate, out newRate))
            {
                Settings.MaxFlowRate = (int)newRate;
            }

            // Max Flow Time
            GUILayout.BeginHorizontal();
            GUILayout.Space(30);
            guiLabel = new GUIContent(" - Max Flow Time:", "Sets the maximum duration (in sec) of a resource transfer.\r\nWorks in conjunction with the Flow rate.  if time it would take\r\nto move a resource exceeds this number, this number will be used to calculate an adjusted flow rate.\r\n(protects your from 20 minute Xfers)");
            GUILayout.Label(guiLabel, GUILayout.Width(130), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 80, 0 - ScrollViewerPosition.y);
            }
            strMaxFlowTime = GUILayout.TextField(strMaxFlowTime, 20, GUILayout.Height(20), GUILayout.Width(80));
            guiLabel       = new GUIContent("Sec", "Sets the maximum duration (in sec) of a resource transfer.\r\nWorks in conjunction with the Flow rate.  if time it would take\r\nto move a resource exceeds this number, this number will be used to calculate an adjusted flow rate.\r\n(protects your from 20 minute Xfers)");
            GUILayout.Label(guiLabel, GUILayout.Width(80), GUILayout.Height(20));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
            GUILayout.EndHorizontal();
            if (float.TryParse(strMaxFlowTime, out newRate))
            {
                Settings.MaxFlowTimeSec = (int)newRate;
            }

            // reset gui.enabled to default
            GUI.enabled = isEnabled;

            // LockSettings Mode
            guiLabel = new GUIContent("Lock Settings  (If set ON, disable in config file)", "Locks the settings in this section so they cannot be altered in game.\r\nTo turn off Locking you MUST edit the Config.xml file.");
            Settings.LockSettings = GUILayout.Toggle(Settings.LockSettings, guiLabel, GUILayout.Width(300));
            rect = GUILayoutUtility.GetLastRect();
            if (Event.current.type == EventType.Repaint && ShowToolTips == true)
            {
                ToolTip = Utilities.SetActiveTooltip(rect, Settings.SettingsPosition, GUI.tooltip, ref ToolTipActive, 10, 0 - ScrollViewerPosition.y);
            }
        }
Beispiel #2
0
        private static void DisplayHighlighting()
        {
            string label = "";

            GUI.enabled = true;
            GUILayout.Label("-------------------------------------------------------------------", GUILayout.Height(10));
            GUILayout.Label("Highlighting", GUILayout.Height(10));
            GUILayout.Label("-------------------------------------------------------------------", GUILayout.Height(16));

            // EnableHighlighting Mode
            GUILayout.BeginHorizontal();
            label = "Enable Highlighting";
            Settings.EnableHighlighting = GUILayout.Toggle(Settings.EnableHighlighting, label, GUILayout.Width(300));
            GUILayout.EndHorizontal();
            if (Settings.EnableHighlighting != Settings.prevEnableHighlighting && HighLogic.LoadedSceneIsFlight)
            {
                if (Settings.EnableCLS)
                {
                    if (SMAddon.smController.SelectedResource == "Crew")
                    {
                        SMAddon.HighlightCLSVessel(Settings.EnableHighlighting, true);
                        // Update spaces and reassign the resource to observe new settings.
                        SMAddon.UpdateCLSSpaces();
                        SMAddon.smController.SelectedResource = "Crew";
                    }
                }
            }

            // OnlySourceTarget Mode
            GUI.enabled = true;
            if (!Settings.EnableHighlighting)
            {
                GUI.enabled = false;
            }
            else
            {
                GUI.enabled = true;
            }
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            label = "Highlight Only Source / Target Parts";
            Settings.OnlySourceTarget = GUILayout.Toggle(Settings.OnlySourceTarget, label, GUILayout.Width(300));
            GUILayout.EndHorizontal();
            if (Settings.OnlySourceTarget && !Settings.prevOnlySourceTarget)
            {
                Settings.EnableCLSHighlighting = false;
                if (HighLogic.LoadedSceneIsFlight && Settings.EnableCLS && SMAddon.smController.SelectedResource == "Crew")
                {
                    SMAddon.HighlightCLSVessel(false, true);
                    // Update spaces and reassign the resource to observe new settings.
                    SMAddon.UpdateCLSSpaces();
                    SMAddon.smController.SelectedResource = "Crew";
                }
            }
            if (!Settings.EnableHighlighting || !Settings.EnableCLS)
            {
                GUI.enabled = false;
            }
            else
            {
                GUI.enabled = true;
            }
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            label = "Enable CLS Highlighting";
            Settings.EnableCLSHighlighting = GUILayout.Toggle(Settings.EnableCLSHighlighting, label, GUILayout.Width(300));
            GUILayout.EndHorizontal();
            if (Settings.EnableCLSHighlighting && !Settings.prevEnableCLSHighlighting)
            {
                Settings.OnlySourceTarget = false;
            }
            if (HighLogic.LoadedSceneIsFlight && Settings.EnableCLS && SMAddon.smController.SelectedResource == "Crew" && Settings.ShowTransferWindow)
            {
                if (Settings.EnableCLSHighlighting != Settings.prevEnableCLSHighlighting)
                {
                    SMAddon.HighlightCLSVessel(Settings.EnableCLSHighlighting);
                }
            }
        }
Beispiel #3
0
        internal static void DisplayWindowTabs()
        {
            GUILayout.BeginHorizontal();

            if (!Settings.EnableCLS)
            {
                GUI.enabled = false;
            }
            var hatchesStyle = ShowHatch ? SMStyle.ButtonToggledStyle : SMStyle.ButtonStyle;

            if (GUILayout.Button("Hatches", hatchesStyle, GUILayout.Height(20)))
            {
                try
                {
                    SMAddon.UpdateCLSSpaces();
                    SMAddon.smController.GetHatches();
                    ShowHatch = !ShowHatch;
                }
                catch (Exception ex)
                {
                    Utilities.LogMessage(string.Format(" opening Hatches Tab.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
                }
            }
            GUI.enabled = true;
            var panelsStyle = ShowPanel ? SMStyle.ButtonToggledStyle : SMStyle.ButtonStyle;

            if (GUILayout.Button("Solar Panels", panelsStyle, GUILayout.Height(20)))
            {
                try
                {
                    SMAddon.smController.GetSolarPanels();
                    ShowPanel = !ShowPanel;
                }
                catch (Exception ex)
                {
                    Utilities.LogMessage(string.Format(" opening Solar Panels Tab.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
                }
            }
            var antennaStyle = ShowAntenna ? SMStyle.ButtonToggledStyle : SMStyle.ButtonStyle;

            if (GUILayout.Button("Antennas", antennaStyle, GUILayout.Height(20)))
            {
                try
                {
                    SMAddon.smController.GetAntennas();
                    ShowAntenna = !ShowAntenna;
                }
                catch (Exception ex)
                {
                    Utilities.LogMessage(string.Format(" opening Antennas Tab.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
                }
            }
            var lightsStyle = ShowLight ? SMStyle.ButtonToggledStyle : SMStyle.ButtonStyle;

            if (GUILayout.Button("Lights", lightsStyle, GUILayout.Height(20)))
            {
                try
                {
                    SMAddon.smController.GetLights();
                    ShowLight = !ShowLight;
                }
                catch (Exception ex)
                {
                    Utilities.LogMessage(string.Format(" opening Lights Tab.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace), "Error", true);
                }
            }
            GUILayout.EndHorizontal();
        }