CSGO-Projects/DamageCalculator/DamageCalculator/MainWindow.xaml
2022-05-15 02:30:53 +02:00

208 lines
14 KiB
XML

<Window x:Class="Damage_Calculator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Damage_Calculator"
mc:Ignorable="d"
Title="CS:GO Damage Calculator" Height="566" Width="1030" MinHeight="700" MinWidth="1000"
Style="{DynamicResource CustomWindowStyle}"
WindowStartupLocation="CenterScreen" Icon="27.ico"
WindowState="Maximized"
MouseMove="Window_MouseMove"
PreviewKeyDown="Window_PreviewKeyDown"
PreviewKeyUp="Window_PreviewKeyUp"
PreviewMouseDown="Window_PreviewMouseDown">
<Grid>
<Menu>
<MenuItem Header="Edit">
<MenuItem x:Name="mnuOpenSettings" Header="Settings..." Click="mnuOpenSettings_Click" />
</MenuItem>
<MenuItem Header="Help">
<MenuItem x:Name="mnuAbout" Header="About..." Uid="0" Click="mnuAbout_Click" />
<MenuItem x:Name="mnuHelp" Header="Help..." Uid="0" Click="mnuHelp_Click" />
</MenuItem>
</Menu>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160" />
<ColumnDefinition />
<ColumnDefinition Width="250" />
</Grid.ColumnDefinitions>
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" Grid.Column="1" Margin="0,0,0,5">
<TextBlock FontWeight="Bold" Text="Mode:" />
<RadioButton x:Name="radioModeShooting" Content="Shooting" IsChecked="True" Checked="radioModeShooting_Checked" />
<RadioButton x:Name="radioModeBomb" Content="Bomb" Checked="radioModeBomb_Checked"/>
</StackPanel>
<StackPanel x:Name="topStackPanel" Orientation="Horizontal" HorizontalAlignment="Center" Grid.ColumnSpan="2" VerticalAlignment="Center">
<TextBlock Text="Map:" VerticalAlignment="Center" FontWeight="Bold" />
<ComboBox x:Name="comboBoxMaps" Margin="10,0,0,0" Height="25" Width="200" VerticalAlignment="Top" SelectionChanged="comboBoxMaps_SelectionChanged" />
</StackPanel>
<StackPanel Margin="0,0,10,5" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Column="1">
<TextBlock FontWeight="Bold" Text="Distance:" />
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="txtEasterEggMetres" Text="Metres:" />
<TextBlock x:Name="textDistanceMetres" Text="0" Margin="10,0,0,0" Foreground="IndianRed" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Inches/Units:" />
<TextBlock x:Name="textDistanceUnits" Text="0" Margin="10,0,0,0" Foreground="IndianRed" />
</StackPanel>
</StackPanel>
<Rectangle x:Name="rectTop" VerticalAlignment="Top" Grid.Row="1" Height="1" Fill="White" Grid.ColumnSpan="3" />
<Rectangle x:Name="rectLeftSide" HorizontalAlignment="Left" Width="1" Grid.Row="1" Grid.Column="1" Fill="White" />
<Rectangle x:Name="rectRightSide" HorizontalAlignment="Right" Width="1" Grid.Row="1" Grid.Column="1" Fill="White" />
<StackPanel x:Name="leftStackPanel" Margin="10,20,0,0" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<StackPanel>
<StackPanel>
<TextBlock Text="Armor:" FontSize="14" FontWeight="Bold" />
<StackPanel x:Name="stackArmorSeparated">
<CheckBox x:Name="chkHelmet" Content="Helmet" Checked="settings_Updated" Unchecked="settings_Updated" />
<CheckBox x:Name="chkKevlar" Content="Body armor" Checked="settings_Updated" Unchecked="settings_Updated" />
</StackPanel>
<CheckBox x:Name="chkArmorAny" Visibility="Collapsed" Content="Yes" Checked="settings_Updated" Unchecked="settings_Updated" />
</StackPanel>
<StackPanel x:Name="stackAreaHit" Margin="0,20,0,0">
<TextBlock Text="Area hit:" FontSize="14" FontWeight="Bold" />
<RadioButton x:Name="radioHead" Content="Head" Checked="settings_Updated" />
<RadioButton x:Name="radioChestArms" Content="Chest/Arms" IsChecked="True" Checked="settings_Updated" />
<RadioButton x:Name="radioStomach" Content="Stomach" Checked="settings_Updated" />
<RadioButton x:Name="radioLegs" Content="Legs" Checked="settings_Updated" />
</StackPanel>
<StackPanel x:Name="stackWeaponUsed" Margin="0,20,0,0">
<TextBlock Text="Weapon used:" FontSize="14" FontWeight="Bold" />
<ComboBox x:Name="comboWeapons" MinWidth="100" MaxWidth="200" HorizontalAlignment="Left" SelectionChanged="comboWeapons_SelectionChanged" />
</StackPanel>
<StackPanel Margin="0,20,0,0">
<TextBlock Text="Resulting damage:" FontSize="14" FontWeight="Bold" />
<TextBlock x:Name="txtResult" Text="0" Foreground="IndianRed" FontSize="18" />
<TextBlock x:Name="txtResultArmor" Text="0" Foreground="CadetBlue" FontSize="14" />
</StackPanel>
<StackPanel Margin="0,20,0,0">
<TextBlock Text="Distance moved.." FontSize="14" FontWeight="Bold" />
<StackPanel Margin="0,10,0,0">
<TextBlock Text="..running:" FontSize="12" FontWeight="Bold" />
<TextBlock x:Name="txtTimeRunning" Text="None" TextWrapping="Wrap" />
</StackPanel>
<StackPanel>
<TextBlock Text="..walking:" FontSize="12" FontWeight="Bold" />
<TextBlock x:Name="txtTimeWalking" Text="None" TextWrapping="Wrap" />
</StackPanel>
<StackPanel>
<TextBlock Text="..crouching:" FontSize="12" FontWeight="Bold" />
<TextBlock x:Name="txtTimeCrouching" Text="None" TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<local:ZoomBorder x:Name="rightZoomBorder" Grid.Row="1" Grid.Column="1" Margin="10" ClipToBounds="True" SizeChanged="rightZoomBorder_SizeChanged">
<Viewbox>
<Grid>
<Image x:Name="mapImage" MouseLeftButtonUp="mapImage_MouseLeftButtonUp" HorizontalAlignment="Center" VerticalAlignment="Center" MouseRightButtonUp="mapImage_MouseRightButtonUp" LayoutUpdated="mapImage_LayoutUpdated" />
<Canvas x:Name="mapCanvas" Width="{Binding ActualWidth, ElementName=mapImage, Mode=OneWay}" Height="{Binding ActualHeight, ElementName=mapImage, Mode=OneWay}">
<Canvas.CacheMode>
<BitmapCache RenderAtScale="8" />
</Canvas.CacheMode>
</Canvas>
</Grid>
</Viewbox>
</local:ZoomBorder>
<StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="2" Margin="10,0,10,10">
<GroupBox x:Name="groupWeaponName" Header="WEAPON-NAME">
<StackPanel Orientation="Horizontal">
<StackPanel>
<TextBlock Text="Base damage:" />
<TextBlock Text="... per minute:" />
<TextBlock Text="Firing rate per minute:" />
<TextBlock Text="Armor penetration:" />
<TextBlock Text="Damage dropoff:" />
<TextBlock Text="Max bullet range:" />
<TextBlock Text="Headshot modifier:" />
<TextBlock Text="Running speed:" />
</StackPanel>
<StackPanel x:Name="stackWeaponInfo">
<TextBlock x:Name="txtWeaponBaseDamage" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponBaseDamagePerMinute" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponFireRate" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponArmorPenetration" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponDamageDropoff" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponMaxRange" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponHeadshotModifier" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtWeaponRunningSpeed" Text="None" Margin="10,0,0,0" />
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="NAV info" Margin="0,10,0,0">
<StackPanel Orientation="Horizontal">
<StackPanel>
<TextBlock Text="Current layer:" />
<TextBlock Text="Average height:" />
<TextBlock Text="Area ID:" />
<TextBlock Text="Connections:" />
<TextBlock Text="Name:" />
</StackPanel>
<StackPanel x:Name="stackNavInfo">
<TextBlock x:Name="txtNavAreasAmount" Text="None" Margin="10,0,0,0" Foreground="IndianRed" />
<TextBlock x:Name="txtNavAreaHeightPercentage" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtNavAreaID" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtNavAreaConnectionsAmount" Text="None" Margin="10,0,0,0" />
<TextBlock x:Name="txtNavAreaPlace" Text="None" Margin="10,0,0,0" />
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="Map info" Margin="0,10,0,0">
<StackPanel>
<StackPanel>
<CheckBox x:Name="chkHasMapFile" Content="Has map file" IsEnabled="False" />
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="chkHasNavFile" Content="Has NAV file" IsEnabled="False" />
<TextBlock x:Name="txtNavFilePacked" FontSize="10" Margin="5,0,0,0" Text="(Packed)" Visibility="Collapsed" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="chkHasAinFile" Content="Has AIN file" IsEnabled="False" />
<TextBlock x:Name="txtAinFilePacked" FontSize="10" Margin="5,0,0,0" Text="(Packed)" Visibility="Collapsed" />
</StackPanel>
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
<TextBlock Text="Max bomb damage:" />
<TextBlock Margin="5,0,0,0" x:Name="txtBombMaxDamage" Text="0" Foreground="IndianRed" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Bomb radius:" />
<TextBlock Margin="5,0,0,0" x:Name="txtBombRadius" Text="0" Foreground="IndianRed" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Bomb spots:" />
<TextBlock Margin="5,0,0,0" x:Name="txtAmountBombTargets" Text="0" Foreground="IndianRed" />
</StackPanel>
</StackPanel>
<StackPanel Margin="0,10,0,0">
<TextBlock Text="Cursor position:" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="X:" />
<TextBlock x:Name="txtCursorX" Text="0" Margin="10,0,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Y:" />
<TextBlock x:Name="txtCursorY" Text="0" Margin="10,0,0,0" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Z:" />
<TextBlock x:Name="txtCursorZ" Text="0" Margin="10,0,0,0" />
</StackPanel>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</Grid>
<Grid x:Name="gridLoading" Background="#B2000000" Visibility="Collapsed">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="Loading maps and weapon stats..." HorizontalAlignment="Center" FontSize="18" />
<TextBlock Text="(This can take up to a few minutes if this is the first start or the if weapon stats got updated recently.)" HorizontalAlignment="Center" />
</StackPanel>
</Grid>
</Grid>
</Window>