Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
rex706 committed Dec 13, 2016
1 parent 085e9b0 commit 22cac58
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
1 change: 1 addition & 0 deletions ARMA FOV Changer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
<Label x:Name="uiTopLeftYLabel_Copy2" HorizontalAlignment="Left" Height="23" Margin="131,256,0,0" Content="" VerticalAlignment="Top" Width="89"/>
<Label x:Name="uiBottomRightXLabel_Copy2" HorizontalAlignment="Left" Height="23" Margin="131,293,0,0" Content="" VerticalAlignment="Top" Width="86"/>
<Label x:Name="uiBottomRightYLabel_Copy2" HorizontalAlignment="Left" Height="23" Margin="131,321,0,0" Content="" VerticalAlignment="Top" Width="86"/>
<CheckBox x:Name="autoCheckBox" Content="Auto" HorizontalAlignment="Left" Margin="32,133,0,0" VerticalAlignment="Top" Checked="autoCheckBox_Checked" Unchecked="autoCheckBox_Unchecked" Visibility="Hidden" ToolTip="Autofill Fov settings"/>
</Grid>
</Window>
35 changes: 27 additions & 8 deletions ARMA FOV Changer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ private void LoadProfile()
if (button == ColdWar)
{
profileName = profilePath.Substring(cwSlashIdx + 1, profNameLengthCW - 1);
fovSlider.IsEnabled = false;
fovSlider.ToolTip = "Disabled for Cold War Assault";
fovLabel.Content = "auto";
autoCheckBox.Visibility = Visibility.Visible;
}
else
{
Expand Down Expand Up @@ -276,7 +274,10 @@ private void saveButton_Click(object sender, RoutedEventArgs e)

if (button == ColdWar)
{

uiTopLeftXLabel_Copy2.Content = uiTopLeftXTextBox.Text;
uiTopLeftYLabel_Copy2.Content = uiTopLeftYTextBox.Text;
uiBottomRightXLabel_Copy2.Content = uiBottomRightXTextBox.Text;
uiBottomRightYLabel_Copy2.Content = uiBottomRightYTextBox.Text;
}
}
catch (Exception m)
Expand All @@ -290,7 +291,7 @@ private void saveButton_Click(object sender, RoutedEventArgs e)
private void refreshMath()
{
desiredFov = (int)fovSlider.Value;
if (button != ColdWar)
if (autoCheckBox.IsChecked == false)
{
fovLabel.Content = fovSlider.Value.ToString() + "°";
}
Expand Down Expand Up @@ -430,9 +431,6 @@ private void refreshMath()
// If user chose Cold War Assault, set up respective ui labels.
if (button == ColdWar)
{
DesiredFovTopTextBox.Text = cwFovTop.ToString();
DesiredFovLeftTextBox.Text = cwFovLeft.ToString();

uiTopLeftXLabel.IsEnabled = true;
uiTopLeftXTextBox.IsEnabled = true;
uiTopLeftYLabel.IsEnabled = true;
Expand All @@ -447,6 +445,12 @@ private void refreshMath()
uiBottomRightXTextBox.Text = uiBottomRightX.ToString();
uiBottomRightYTextBox.Text = uiBottomRightY.ToString();
}

if (autoCheckBox.IsChecked == true)
{
DesiredFovTopTextBox.Text = cwFovTop.ToString();
DesiredFovLeftTextBox.Text = cwFovLeft.ToString();
}
else
{
// Desired fov to radians
Expand Down Expand Up @@ -519,6 +523,8 @@ private static async Task<int> CheckForUpdate()

private void ProfileMenuItem_Click(object sender, RoutedEventArgs e)
{
autoCheckBox.Visibility = Visibility.Hidden;

fovSlider.IsEnabled = true;
fovSlider.ToolTip = null;

Expand Down Expand Up @@ -582,5 +588,18 @@ private void ExitMenuItem_Click(object sender, RoutedEventArgs e)
{
Close();
}

private void autoCheckBox_Checked(object sender, RoutedEventArgs e)
{
fovSlider.IsEnabled = false;
fovLabel.Content = "Auto";
refreshMath();
}

private void autoCheckBox_Unchecked(object sender, RoutedEventArgs e)
{
fovSlider.IsEnabled = true;
refreshMath();
}
}
}
4 changes: 2 additions & 2 deletions ARMA FOV Changer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: AssemblyVersion("1.2.1.1")]
[assembly: AssemblyFileVersion("1.2.1.1")]

0 comments on commit 22cac58

Please sign in to comment.