diff --git a/ValorantCC/MainWindow.xaml.cs b/ValorantCC/MainWindow.xaml.cs index 83d90c0..b14ede4 100644 --- a/ValorantCC/MainWindow.xaml.cs +++ b/ValorantCC/MainWindow.xaml.cs @@ -327,6 +327,7 @@ private void btnCommunityProfiles_Click(object sender, RoutedEventArgs e) }catch(Exception ex) { ProfilesWindow publicProfiles = new ProfilesWindow(SelectedProfile, ValCCAPI); + publicProfiles.Owner = this; publicProfiles.Show(); } } diff --git a/ValorantCC/SubWindow/ProfilesWindow.xaml b/ValorantCC/SubWindow/ProfilesWindow.xaml index 34021a4..9327538 100644 --- a/ValorantCC/SubWindow/ProfilesWindow.xaml +++ b/ValorantCC/SubWindow/ProfilesWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:ValorantCC" mc:Ignorable="d" - Title="ProfilesWindow" Height="Auto" Width="Auto" ResizeMode="NoResize" SizeToContent="WidthAndHeight"> + Title="ProfilesWindow" Height="Auto" Width="Auto" ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" WindowStartupLocation="CenterOwner"> diff --git a/ValorantCC/SubWindow/ProfilesWindow.xaml.cs b/ValorantCC/SubWindow/ProfilesWindow.xaml.cs index a8dee76..c48bb94 100644 --- a/ValorantCC/SubWindow/ProfilesWindow.xaml.cs +++ b/ValorantCC/SubWindow/ProfilesWindow.xaml.cs @@ -266,8 +266,12 @@ private async Task CreateRender(PublicProfile profile) Grid0.Children.Add(detailsButton); Grid0.Children.Add(applyButton); - Crosshair_Parser.Generate(0, Grid0, profile.settings.Primary); - Crosshair_Parser.Generate(2, Grid0, profile.settings.aDS); + var cross = profile.settings.Primary; + Crosshair_Parser.Generate(0, Grid0, cross); + if (!profile.settings.bUsePrimaryCrosshairForADS) + cross = profile.settings.aDS; + Crosshair_Parser.Generate(1, Grid0, cross); + Crosshair_Parser.Generate(2, Grid0, profile.settings.Sniper); template.Child = Grid0; await Task.Delay(1); return template; diff --git a/ValorantCC/src/Crosshair_Parser.cs b/ValorantCC/src/Crosshair_Parser.cs index 4bfe620..f9b02a2 100644 --- a/ValorantCC/src/Crosshair_Parser.cs +++ b/ValorantCC/src/Crosshair_Parser.cs @@ -22,11 +22,13 @@ public static void Generate(int column, Grid grid, ProfileSettings settings) int recindex = 0; for (int i = 0; i < rectangles.Length; i++) { - Rectangle rectangle = new Rectangle() + Rectangle rectangle = new() { Width = 3, Height = 3 }; + if (recindex > 7) + rectangle.Name = "OL"; rectangles[recindex] = rectangle; recindex++; } @@ -35,7 +37,7 @@ public static void Generate(int column, Grid grid, ProfileSettings settings) for (int i = 0; i < rectangles.Length; i+=2) { var pos = Position.East; - switch (recindex % 4) + switch (recindex) { case 1: pos = Position.East; @@ -46,13 +48,13 @@ public static void Generate(int column, Grid grid, ProfileSettings settings) case 3: pos = Position.North; break; - case 0: + case 4: pos = Position.South; break; } - recindex++; if(recindex == 4) recindex = 0; + recindex++; rectangle_redraw(rectangles[i], rectangles[i + 1], pos, settings); rectangles[i].Fill = new SolidColorBrush(Color.FromRgb(settings.Color.R, settings.Color.G, settings.Color.B)); @@ -62,8 +64,8 @@ public static void Generate(int column, Grid grid, ProfileSettings settings) Grid.SetColumn(rectangles[i + 1], column); Grid.SetRow(rectangles[i + 1], 0); - grid.Children.Add(rectangles[i]); grid.Children.Add(rectangles[i + 1]); + grid.Children.Add(rectangles[i]); } Rectangle dot = new Rectangle() @@ -76,13 +78,26 @@ public static void Generate(int column, Grid grid, ProfileSettings settings) }; dot_redraw(dot, dotOT, settings); + dot.Fill = new SolidColorBrush(Color.FromRgb(settings.Color.R, settings.Color.G, settings.Color.B)); + dotOT.Stroke = new SolidColorBrush(Color.FromRgb(settings.OutlineColor.R, settings.OutlineColor.G, settings.OutlineColor.B)); Grid.SetColumn(dot, column); Grid.SetRow(dot, 0); Grid.SetColumn(dotOT, column); Grid.SetColumn(dotOT, 0); - grid.Children.Add(dot); grid.Children.Add(dotOT); + grid.Children.Add(dot); + } + + public static void Generate(int column, Grid grid, SniperSettings settings) + { + Ellipse ellipse = new(); + dot_redraw(ellipse, settings); + ellipse.Fill = new SolidColorBrush(Color.FromRgb(settings.CenterDotColor.R, settings.CenterDotColor.G, settings.CenterDotColor.B)); + Grid.SetColumn(ellipse, column); + Grid.SetRow(ellipse, 0); + + grid.Children.Add(ellipse); } public static void dot_redraw(Rectangle Rect, Rectangle RectOT, ProfileSettings settings)