diff --git a/DCS-SR-Client/DCS-SR-Client.csproj b/DCS-SR-Client/DCS-SR-Client.csproj index b145fa2d..db7aa3fa 100644 --- a/DCS-SR-Client/DCS-SR-Client.csproj +++ b/DCS-SR-Client/DCS-SR-Client.csproj @@ -517,6 +517,9 @@ Settings.settings True + + Always + PublicResXFileCodeGenerator diff --git a/DCS-SR-Client/SRS_Orientation_Toggle.png b/DCS-SR-Client/SRS_Orientation_Toggle.png new file mode 100644 index 00000000..e386d3f2 Binary files /dev/null and b/DCS-SR-Client/SRS_Orientation_Toggle.png differ diff --git a/DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs b/DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs index 8e535c82..7d894f2c 100644 --- a/DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs +++ b/DCS-SR-Client/UI/ClientWindow/MainWindow.xaml.cs @@ -1461,28 +1461,28 @@ private void ToggleOverlay(bool uiButton, int switchTo) switch (switchTo) { case 0: - windows[switchTo] = new RadioOverlayWindowTwoVertical(); + windows[switchTo] = new RadioOverlayWindowTwoVertical(ToggleOverlay); break; case 1: - windows[switchTo] = new RadioOverlayWindowThreeVertical(); + windows[switchTo] = new RadioOverlayWindowThreeVertical(ToggleOverlay); break; case 2: - windows[switchTo] = new RadioOverlayWindowFiveVertical(); + windows[switchTo] = new RadioOverlayWindowFiveVertical(ToggleOverlay); break; case 3: - windows[switchTo] = new RadioOverlayWindowTenVertical(); + windows[switchTo] = new RadioOverlayWindowTenVertical(ToggleOverlay); break; case 4: - windows[switchTo] = new RadioOverlayWindowTwoHorizontal(); + windows[switchTo] = new RadioOverlayWindowTwoHorizontal(ToggleOverlay); break; case 5: - windows[switchTo] = new RadioOverlayWindowThreeHorizontal(); + windows[switchTo] = new RadioOverlayWindowThreeHorizontal(ToggleOverlay); break; case 6: - windows[switchTo] = new RadioOverlayWindowFiveHorizontal(); + windows[switchTo] = new RadioOverlayWindowFiveHorizontal(ToggleOverlay); break; case 7: - windows[switchTo] = new RadioOverlayWindowTenHorizontal(); + windows[switchTo] = new RadioOverlayWindowTenHorizontal(ToggleOverlay); break; } try diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml index 74346489..1faaf168 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayFiveHorizontal.xaml @@ -79,6 +79,25 @@ + + - diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs index 399c802d..5a5b3d1b 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoHorizontal.xaml.cs @@ -31,7 +31,9 @@ public partial class RadioOverlayWindowTwoHorizontal : Window private GlobalSettingsStore _globalSettings = GlobalSettingsStore.Instance; - public RadioOverlayWindowTwoHorizontal() + private Action _toggleOverlay; + + public RadioOverlayWindowTwoHorizontal(Action ToggleOverlay) { InitializeComponent(); @@ -42,7 +44,6 @@ public RadioOverlayWindowTwoHorizontal() AllowsTransparency = true; Opacity = _globalSettings.GetPositionSetting(GlobalSettingsKeys.RadioTwoHorizontalOpacity).DoubleValue; windowOpacitySlider.Value = Opacity; - Left = _globalSettings.GetPositionSetting(GlobalSettingsKeys.RadioTwoHorizontalX).DoubleValue; Top = _globalSettings.GetPositionSetting(GlobalSettingsKeys.RadioTwoHorizontalY).DoubleValue; @@ -66,6 +67,8 @@ public RadioOverlayWindowTwoHorizontal() _updateTimer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(80)}; _updateTimer.Tick += RadioRefresh; _updateTimer.Start(); + + this._toggleOverlay = ToggleOverlay; } private void Location_Changed(object sender, EventArgs e) @@ -166,6 +169,12 @@ private void Button_Close(object sender, RoutedEventArgs e) Close(); } + private void Button_Swap_Orientation(object sender, RoutedEventArgs e) + { + Close(); + _toggleOverlay(true, 1); // index 1 is the vertical orientation + } + private void windowOpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { Opacity = e.NewValue; diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml index 4c8fcaa0..9be08f6d 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml @@ -33,25 +33,44 @@ + Text="2 Radio Panel" /> + + diff --git a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs index afb6f965..67841ff5 100644 --- a/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs +++ b/DCS-SR-Client/UI/RadioOverlayWindow/RadioOverlayTwoVertical.xaml.cs @@ -43,8 +43,9 @@ public partial class RadioOverlayWindowTwoVertical : Window private long _lastUnitId; + private readonly Action _toggleOverlay; - public RadioOverlayWindowTwoVertical() + public RadioOverlayWindowTwoVertical(Action ToggleOverlay) { //load opacity before the intialising as the slider changed //method fires after initialisation @@ -87,6 +88,7 @@ public RadioOverlayWindowTwoVertical() _updateTimer = new DispatcherTimer {Interval = TimeSpan.FromMilliseconds(80)}; _updateTimer.Tick += RadioRefresh; _updateTimer.Start(); + this._toggleOverlay = ToggleOverlay; } private void Location_Changed(object sender, EventArgs e) @@ -272,6 +274,12 @@ private void Button_Close(object sender, RoutedEventArgs e) Close(); } + private void Button_Swap_Orientation(object sender, RoutedEventArgs e) + { + Close(); + _toggleOverlay(true, 4); // index 4 is the horizontal orientation + } + private void windowOpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) { Opacity = e.NewValue;