Exemplo n.º 1
0
        internal static void DisplayTabActions()
        {
            GUILayout.BeginHorizontal();
            switch (_selectedTab)
            {
            case Tab.Panel:
                GUI.enabled = SMAddon.SmVessel.SolarPanels.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_016"), GUILayout.Height(20))) // "Retract All Solar Panels"
                {
                    TabSolarPanel.RetractAllPanels();
                }
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_007"), GUILayout.Height(20))) // "Extend All Solar Panels"
                {
                    TabSolarPanel.ExtendAllPanels();
                }
                break;

            case Tab.Hatch:
                GUI.enabled = SMAddon.SmVessel.Hatches.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_008"), GUILayout.Height(20))) // "Close All Hatches"
                {
                    TabHatch.CloseAllHatches();
                }
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_009"), GUILayout.Height(20))) // "Open All Hatches"
                {
                    TabHatch.OpenAllHatches();
                }
                break;

            case Tab.Antenna:
                GUI.enabled = SMAddon.SmVessel.Antennas.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_010"), GUILayout.Height(20))) // "Retract All Antennas"
                {
                    TabAntenna.RetractAllAntennas();
                }
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_011"), GUILayout.Height(20))) // "Extend All Antennas"
                {
                    TabAntenna.ExtendAllAntennas();
                }
                break;

            case Tab.Light:
                GUI.enabled = SMAddon.SmVessel.Lights.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_012"), GUILayout.Height(20))) // "Turn Off All Lights"
                {
                    TabLight.TurnOffAllLights();
                }
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_013"), GUILayout.Height(20))) // "Turn On All Lights"
                {
                    TabLight.TurnOnAllLights();
                }
                break;

            case Tab.Lab:
                GUI.enabled = SMAddon.SmVessel.Labs.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_014"), GUILayout.Height(20))) // "Turn Off All Labs"
                {
                    TabLight.TurnOffAllLights();
                }
                if (GUILayout.Button(SMUtils.Localize("#smloc_control_015"), GUILayout.Height(20))) // "Turn On All Labs"
                {
                    TabLight.TurnOnAllLights();
                }
                break;

            case Tab.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
        }
Exemplo n.º 2
0
        internal static void DisplayTabActions()
        {
            GUILayout.BeginHorizontal();
            switch (_selectedTab)
            {
            case Tab.Panel:
                GUI.enabled = SMAddon.SmVessel.SolarPanels.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_016"], GUILayout.Height(20))) // "Retract All Solar Panels"
                {
                    TabSolarPanel.RetractAllPanels();
                }
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_007"], GUILayout.Height(20))) // "Extend All Solar Panels"
                {
                    TabSolarPanel.ExtendAllPanels();
                }
                break;

            case Tab.Hatch:
                GUI.enabled = SMAddon.SmVessel.Hatches.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_008"], GUILayout.Height(20))) // "Close All Hatches"
                {
                    TabHatch.CloseAllHatches();
                }
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_009"], GUILayout.Height(20))) // "Open All Hatches"
                {
                    TabHatch.OpenAllHatches();
                }
                break;

            case Tab.Antenna:
                GUI.enabled = SMAddon.SmVessel.Antennas.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_010"], GUILayout.Height(20))) // "Retract All Antennas"
                {
                    TabAntenna.RetractAllAntennas();
                }
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_011"], GUILayout.Height(20))) // "Extend All Antennas"
                {
                    TabAntenna.ExtendAllAntennas();
                }
                break;

            case Tab.Light:
                GUI.enabled = SMAddon.SmVessel.Lights.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_012"], GUILayout.Height(20))) // "Turn Off All Lights"
                {
                    TabLight.TurnOffAllLights();
                }
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_013"], GUILayout.Height(20))) // "Turn On All Lights"
                {
                    TabLight.TurnOnAllLights();
                }
                break;

            case Tab.Lab:
                GUI.enabled = SMAddon.SmVessel.Labs.Count > 0 && (!SMSettings.RealControl || SMConditions.IsShipControllable());
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_014"], GUILayout.Height(20))) // "Turn Off All Labs"
                {
                    TabLight.TurnOffAllLights();
                }
                if (GUILayout.Button(SmUtils.SmTags["#smloc_control_015"], GUILayout.Height(20))) // "Turn On All Labs"
                {
                    TabLight.TurnOnAllLights();
                }
                break;

            case Tab.Vessel:
                // Temporary commenting of code to allow release.  Will work Vessel combining in later release.
                //GUI.enabled = TabVessel.CombineVesselCount > 0;
                //if (GUILayout.Button(SmUtils.SmTags["#smloc_control_018"], GUILayout.Height(20))) // "Combine Selected Vessels"
                //  TabVessel.CombineSelectedVessels();
                //if (GUILayout.Button(SmUtils.SmTags["#smloc_control_019"], GUILayout.Height(20))) // "Clear Vessel Selections"
                //  TabVessel.ClearVesselCount();
                break;

            case Tab.None:
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
        }