diff --git a/ARMA FOV Changer/MainWindow.xaml b/ARMA FOV Changer/MainWindow.xaml
index 04335d1..48fc4ce 100644
--- a/ARMA FOV Changer/MainWindow.xaml
+++ b/ARMA FOV Changer/MainWindow.xaml
@@ -28,9 +28,8 @@
-
-
-
+
+
@@ -57,5 +56,8 @@
+
+
+
diff --git a/ARMA FOV Changer/MainWindow.xaml.cs b/ARMA FOV Changer/MainWindow.xaml.cs
index 079f32b..59934db 100644
--- a/ARMA FOV Changer/MainWindow.xaml.cs
+++ b/ARMA FOV Changer/MainWindow.xaml.cs
@@ -14,7 +14,7 @@ namespace ARMA_FOV_Changer
///
/// Interaction logic for MainWindow.xaml
///
-
+
public partial class MainWindow : Window
{
private static Version latest;
@@ -97,7 +97,7 @@ private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
LoadProfile();
}
-
+
private void LoadProfile()
{
// Open splash window for game selection.
@@ -122,7 +122,7 @@ private void LoadProfile()
// Get profile name from file path string.
int lastSlashIdx = profilePath.LastIndexOf("\\") + 1;
int profNameLength = profilePath.LastIndexOf(".") - lastSlashIdx;
-
+
int cwSlashIdx = lastSlashIdx > 0 ? profilePath.LastIndexOf("\\", lastSlashIdx - 2) : -1;
int profNameLengthCW = profilePath.LastIndexOf("\\") - cwSlashIdx;
@@ -243,7 +243,7 @@ private void LoadProfile()
}
private void saveButton_Click(object sender, RoutedEventArgs e)
- {
+ {
// Overwrite fov values.
arrLine[fovTopLine] = fovstring + "=" + DesiredFovTopTextBox.Text + ";";
if (button != DayZ)
@@ -293,7 +293,7 @@ private void refreshMath()
desiredFov = (int)fovSlider.Value;
if (autoCheckBox.IsChecked == false)
{
- fovLabel.Content = fovSlider.Value.ToString() + "°";
+ fovTextBox.Text = fovSlider.Value.ToString();
}
// Find resolution and aspect ratio in saved ratios class.
@@ -325,7 +325,7 @@ private void refreshMath()
double uiBottomRightY = 1.0;
double cwFovTop = 0.75;
double cwFovLeft = 1.0;
-
+
// Set up aspect ratio variables and ui scaling based on http://ofp-faguss.com/files/ofp_aspect_ratio.pdf
if (testRatio == 1.25)
{
@@ -333,7 +333,7 @@ private void refreshMath()
cwFovTop = 0.8;
uiTopLeftY = 0.03125;
uiBottomRightY = 0.96875;
- }
+ }
else if (testRatio == 1.33 || testRatio == 1.37)
{
aspectRatio = "4:3";
@@ -341,7 +341,7 @@ private void refreshMath()
else if (testRatio == 1.50)
{
aspectRatio = "3:2";
- }
+ }
else if (testRatio == 1.60)
{
aspectRatio = "16:10";
@@ -359,7 +359,7 @@ private void refreshMath()
else if (testRatio == 1.71)
{
aspectRatio = "128:75";
- }
+ }
else if (testRatio == 1.78)
{
aspectRatio = "16:9";
@@ -392,7 +392,7 @@ private void refreshMath()
cwFovLeft = 3.0;
uiTopLeftX = 0.333333;
uiBottomRightX = 0.666667;
- }
+ }
else if (testRatio == 4.80)
{
aspectRatio = "48:10";
@@ -526,6 +526,8 @@ private void ProfileMenuItem_Click(object sender, RoutedEventArgs e)
autoCheckBox.IsChecked = false;
autoCheckBox.Visibility = Visibility.Hidden;
+ scrollBar.IsEnabled = true;
+ fovTextBox.IsEnabled = true;
fovSlider.IsEnabled = true;
fovSlider.ToolTip = null;
@@ -592,15 +594,59 @@ private void ExitMenuItem_Click(object sender, RoutedEventArgs e)
private void autoCheckBox_Checked(object sender, RoutedEventArgs e)
{
+ scrollBar.IsEnabled = false;
fovSlider.IsEnabled = false;
- fovLabel.Content = "Auto";
+ degreeLabel.Visibility = Visibility.Hidden;
+ fovTextBox.Text = "Auto";
+ fovTextBox.IsEnabled = false;
refreshMath();
}
private void autoCheckBox_Unchecked(object sender, RoutedEventArgs e)
{
+ scrollBar.IsEnabled = true;
fovSlider.IsEnabled = true;
+ degreeLabel.Visibility = Visibility.Visible;
+ fovTextBox.IsEnabled = true;
refreshMath();
}
+
+ private void scrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
+ {
+ if (e.NewValue < e.OldValue)
+ fovSlider.Value += 1;
+ else if (e.NewValue > e.OldValue)
+ fovSlider.Value -= 1;
+ }
+
+ private void fovTextBox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ int value;
+
+ if (fovTextBox.Text.Length >= 2)
+ {
+ try
+ {
+ value = Int32.Parse(fovTextBox.Text);
+ }
+ catch
+ {
+ value = 90;
+ }
+
+ if (value >= 65 && value <= 165)
+ {
+ fovSlider.Value = value;
+ }
+ else if (value < 65)
+ {
+ fovSlider.Value = 65;
+ }
+ else if (value > 165)
+ {
+ fovSlider.Value = 165;
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/ARMA FOV Changer/Properties/AssemblyInfo.cs b/ARMA FOV Changer/Properties/AssemblyInfo.cs
index cb01833..d9c101f 100644
--- a/ARMA FOV Changer/Properties/AssemblyInfo.cs
+++ b/ARMA FOV Changer/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.1.1")]
-[assembly: AssemblyFileVersion("1.2.1.1")]
+[assembly: AssemblyVersion("1.2.2.0")]
+[assembly: AssemblyFileVersion("1.2.2.0")]