Ejemplo n.º 1
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            bool first = true;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioReceive();
                radio.RepaintRadioStatus();

                //TODO show and hide radio 4 if its visible
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();


            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var avalilableRadios = 0;

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        avalilableRadios++;
                    }
                }

                if (avalilableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                ControlText.Text = "";
            }

            FocusDCS();
        }
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var IL2PlayerRadioInfo = _clientStateSingleton.PlayerGameState;


            Radio1.RepaintRadioStatus();
            Radio1.RepaintRadioReceive();

            if (IL2PlayerRadioInfo.radios[2].modulation != RadioInformation.Modulation.DISABLED)
            {
                if (Radio2.Visibility == Visibility.Collapsed)
                {
                    //show
                    Radio2.Visibility          = Visibility.Visible;
                    Radio2Seperator.Visibility = Visibility.Visible;
                    MinHeight = _originalMinHeight + 55 + 10;
                    Recalculate();
                }

                Radio2.RepaintRadioStatus();
                Radio2.RepaintRadioReceive();
            }
            else
            {
                if (Radio2.Visibility != Visibility.Collapsed)
                {
                    Radio2.Visibility          = Visibility.Collapsed;
                    MinHeight                  = _originalMinHeight;
                    Radio2Seperator.Visibility = Visibility.Collapsed;
                    Recalculate();
                }
            }

            Intercom.RepaintRadioStatus();

            FocusIL2();
        }
Ejemplo n.º 3
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioStatus();
                radio.RepaintRadioReceive();
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();



            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var availableRadios = 0;

                //handle 4th radio on the overlay or not
                if (dcsPlayerRadioInfo.radios.Length < 5)
                {
                    Radio4.Visibility = Visibility.Collapsed;
                    if (MinHeight != _originalMinHeight)
                    {
                        MinHeight = _originalMinHeight;
                        Recalculate();
                    }
                }
                else
                {
                    if (dcsPlayerRadioInfo.radios[4].modulation == RadioInformation.Modulation.DISABLED)
                    {
                        Radio4.Visibility = Visibility.Collapsed;
                        if (MinHeight != _originalMinHeight)
                        {
                            MinHeight = _originalMinHeight;
                            Recalculate();
                        }
                    }
                    else
                    {
                        //show it
                        Radio4.Visibility = Visibility.Visible;

                        if (MinHeight == _originalMinHeight)
                        {
                            MinHeight += Radio4.Height;
                            Recalculate();
                        }
                    }
                }

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        availableRadios++;
                    }
                }

                if (availableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                Radio4.Visibility = Visibility.Collapsed;
                if (MinHeight != _originalMinHeight)
                {
                    MinHeight = _originalMinHeight;
                    Recalculate();
                }

                ControlText.Text = "";
            }

            FocusDCS();
        }
Ejemplo n.º 4
0
        private void RadioRefresh(object sender, EventArgs eventArgs)
        {
            var dcsPlayerRadioInfo = _clientStateSingleton.DcsPlayerRadioInfo;

            foreach (var radio in radioControlGroup)
            {
                radio.RepaintRadioStatus();
                radio.RepaintRadioReceive();
            }

            Intercom.RepaintRadioStatus();

            TransponderPanel.RepaintTransponderStatus();



            if ((dcsPlayerRadioInfo != null) && dcsPlayerRadioInfo.IsCurrent())
            {
                var availableRadios = 0;

                for (var i = 0; i < dcsPlayerRadioInfo.radios.Length; i++)
                {
                    if (dcsPlayerRadioInfo.radios[i].modulation != RadioInformation.Modulation.DISABLED)
                    {
                        availableRadios++;
                    }
                }

                if (availableRadios == 6 ||
                    dcsPlayerRadioInfo.radios.Length >= 6 &&
                    dcsPlayerRadioInfo.radios[5].modulation != RadioInformation.Modulation.DISABLED)
                {
                    Radio5.Visibility = Visibility.Visible;
                    Radio4.Visibility = Visibility.Visible;

                    if (MinHeight != _originalMinHeight + (_radioHeight * 2))
                    {
                        MinHeight = (_originalMinHeight + (_radioHeight * 2));
                        Recalculate();
                    }
                }
                else if (availableRadios == 5 ||
                         dcsPlayerRadioInfo.radios.Length >= 5 &&
                         dcsPlayerRadioInfo.radios[4].modulation != RadioInformation.Modulation.DISABLED)
                {
                    Radio5.Visibility = Visibility.Collapsed;
                    Radio4.Visibility = Visibility.Visible;
                    if (MinHeight != _originalMinHeight + _radioHeight)
                    {
                        MinHeight = _originalMinHeight + _radioHeight;
                        Recalculate();
                    }
                }
                else
                {
                    ResetHeight();
                }


                if (availableRadios > 1)
                {
                    if (dcsPlayerRadioInfo.control == DCSPlayerRadioInfo.RadioSwitchControls.HOTAS)
                    {
                        ControlText.Text = "HOTAS Controls";
                    }
                    else
                    {
                        ControlText.Text = "Cockpit Controls";
                    }
                }
                else
                {
                    ControlText.Text = "";
                }
            }
            else
            {
                ResetHeight();
                ControlText.Text = "";
            }

            FocusDCS();
        }