diff --git a/ValorantCC/MainWindow.xaml.cs b/ValorantCC/MainWindow.xaml.cs index b356f36..45cdfb3 100644 --- a/ValorantCC/MainWindow.xaml.cs +++ b/ValorantCC/MainWindow.xaml.cs @@ -72,13 +72,18 @@ private void profiles_SelectionChanged(object sender, SelectionChangedEventArgs SelectedIndex = profiles.SelectedIndex; SelectedProfile = DataProcessor.ProfileFromIndex(SelectedIndex); - primary_color.SelectedColor = Color.FromRgb(SelectedProfile.Primary.Color.R, SelectedProfile.Primary.Color.G, SelectedProfile.Primary.Color.B); + CrosshairColor primColor = SelectedProfile.Primary.bUseCustomColor ? SelectedProfile.Primary.colorCustom : SelectedProfile.Primary.Color; + primary_color.SelectedColor = Color.FromRgb(primColor.R, primColor.G, primColor.B); prim_outline_color.SelectedColor = Color.FromRgb(SelectedProfile.Primary.OutlineColor.R, SelectedProfile.Primary.OutlineColor.G, SelectedProfile.Primary.OutlineColor.B); + if (SelectedProfile.aDS == null) SelectedProfile.aDS = SelectedProfile.Primary; if (SelectedProfile.bUsePrimaryCrosshairForADS) SelectedProfile.aDS.Color = SelectedProfile.Primary.Color; - ads_color.SelectedColor = Color.FromRgb(SelectedProfile.aDS.Color.R, SelectedProfile.aDS.Color.G, SelectedProfile.aDS.Color.B); + CrosshairColor adsColor = SelectedProfile.aDS.bUseCustomColor ? SelectedProfile.aDS.colorCustom : SelectedProfile.aDS.Color; + ads_color.SelectedColor = Color.FromRgb(adsColor.R, adsColor.G, adsColor.B); ads_outline_color.SelectedColor = Color.FromRgb(SelectedProfile.aDS.OutlineColor.R, SelectedProfile.aDS.OutlineColor.G, SelectedProfile.aDS.OutlineColor.B); - sniper_dot_color.SelectedColor = Color.FromRgb(SelectedProfile.Sniper.CenterDotColor.R, SelectedProfile.Sniper.CenterDotColor.G, SelectedProfile.Sniper.CenterDotColor.B); + + CrosshairColor sniperColor = SelectedProfile.Sniper.bUseCustomCenterDotColor ? SelectedProfile.Sniper.centerDotColorCustom : SelectedProfile.Sniper.CenterDotColor; + sniper_dot_color.SelectedColor = Color.FromRgb(sniperColor.R, sniperColor.G, sniperColor.B); /*if (!sharedProfileResp.HasValue) { if (ValCCAPI != null) sharedProfileResp = await ValCCAPI.ObtainSelfSaved(); diff --git a/ValorantCC/ValorantCC.csproj b/ValorantCC/ValorantCC.csproj index a3a27b1..bc0ed41 100644 --- a/ValorantCC/ValorantCC.csproj +++ b/ValorantCC/ValorantCC.csproj @@ -14,7 +14,7 @@ false - 3.2.1 + 3.3 true $(MSBuildProjectName) diff --git a/ValorantCC/src/Binder.cs b/ValorantCC/src/Binder.cs index 46b7c36..373f463 100644 --- a/ValorantCC/src/Binder.cs +++ b/ValorantCC/src/Binder.cs @@ -54,6 +54,8 @@ public partial class CrosshairProfile public partial class ProfileSettings { public CrosshairColor Color { get; set; } + public CrosshairColor colorCustom { get; set; } + public bool bUseCustomColor { get; set; } public bool bHasOutline { get; set; } public float OutlineThickness { get; set; } public CrosshairColor OutlineColor { get; set; } @@ -61,6 +63,11 @@ public partial class ProfileSettings public float CenterDotSize { get; set; } public float CenterDotOpacity { get; set; } public bool bDisplayCenterDot { get; set; } + public bool bFadeCrosshairWithFiringError { get; set; } + public bool bShowSpectatedPlayerCrosshair { get; set; } + public bool bHideCrosshair { get; set; } + public bool bTouchCrosshairHighlightEnabled { get; set; } + public CrosshairColor touchCrosshairHighlightColor { get; set; } public bool bFixMinErrorAcrossWeapons { get; set; } public LineSettings InnerLines { get; set; } public LineSettings OuterLines { get; set; } @@ -70,6 +77,8 @@ public partial class ProfileSettings public partial class SniperSettings { public CrosshairColor CenterDotColor { get; set; } + public CrosshairColor centerDotColorCustom { get; set; } + public bool bUseCustomCenterDotColor { get; set; } public float CenterDotSize { get; set; } public float CenterDotOpacity { get; set; } public bool bDisplayCenterDot { get; set; } @@ -86,6 +95,8 @@ public partial class LineSettings { public float LineThickness { get; set; } public float LineLength { get; set; } + public float LineLengthVertical { get; set; } + public bool bAllowVertScaling { get; set; } public float LineOffset { get; set; } public bool bShowMovementError { get; set; } public bool bShowShootingError { get; set; } diff --git a/ValorantCC/src/Crosshair/CrosshairMain.cs b/ValorantCC/src/Crosshair/CrosshairMain.cs index 5b3f990..7424293 100644 --- a/ValorantCC/src/Crosshair/CrosshairMain.cs +++ b/ValorantCC/src/Crosshair/CrosshairMain.cs @@ -9,17 +9,24 @@ namespace ValorantCC.src.Crosshair { public class CrosshairMain { + private static Color WhiteColor = new Color { R = 255, G = 255, B = 255 }; public static Data ChangeInActiveProfile(List Colors, int SelectedIndex, Data UserSettings, ProfileList FetchedProfiles) { Utilities.Utils.Log("Updating inactive color"); var SelectedProfile = FetchedProfiles.Profiles[SelectedIndex]; if (!SelectedProfile.bUseAdvancedOptions) SelectedProfile.bUseAdvancedOptions = true; - SelectedProfile.Primary.Color.R = Colors[0].R; SelectedProfile.Primary.Color.G = Colors[0].G; SelectedProfile.Primary.Color.B = Colors[0].B; SelectedProfile.Primary.Color.A = Colors[0].A; + SelectedProfile.Primary.bUseCustomColor = true; + //SelectedProfile.Primary.Color.R = Colors[0].R; SelectedProfile.Primary.Color.G = Colors[0].G; SelectedProfile.Primary.Color.B = Colors[0].B; SelectedProfile.Primary.Color.A = Colors[0].A; + SelectedProfile.Primary.colorCustom.R = Colors[0].R; SelectedProfile.Primary.colorCustom.G = Colors[0].G; SelectedProfile.Primary.colorCustom.B = Colors[0].B; SelectedProfile.Primary.colorCustom.A = Colors[0].A; SelectedProfile.Primary.OutlineColor.R = Colors[1].R; SelectedProfile.Primary.OutlineColor.G = Colors[1].G; SelectedProfile.Primary.OutlineColor.B = Colors[1].B; SelectedProfile.Primary.OutlineColor.A = Colors[1].A; - SelectedProfile.aDS.Color.R = Colors[2].R; SelectedProfile.aDS.Color.G = Colors[2].G; SelectedProfile.aDS.Color.B = Colors[2].B; SelectedProfile.aDS.Color.A = Colors[2].A; + SelectedProfile.aDS.bUseCustomColor = true; + //SelectedProfile.aDS.Color.R = Colors[2].R; SelectedProfile.aDS.Color.G = Colors[2].G; SelectedProfile.aDS.Color.B = Colors[2].B; SelectedProfile.aDS.Color.A = Colors[2].A; + SelectedProfile.aDS.colorCustom.R = Colors[2].R; SelectedProfile.aDS.colorCustom.G = Colors[2].G; SelectedProfile.aDS.colorCustom.B = Colors[2].B; SelectedProfile.aDS.colorCustom.A = Colors[2].A; SelectedProfile.aDS.OutlineColor.R = Colors[3].R; SelectedProfile.aDS.OutlineColor.G = Colors[3].G; SelectedProfile.aDS.OutlineColor.B = Colors[3].B; SelectedProfile.aDS.OutlineColor.A = Colors[3].A; - SelectedProfile.Sniper.CenterDotColor.R = Colors[4].R; SelectedProfile.Sniper.CenterDotColor.G = Colors[4].G; SelectedProfile.Sniper.CenterDotColor.B = Colors[4].B; SelectedProfile.Sniper.CenterDotColor.A = Colors[4].A; + SelectedProfile.Sniper.bUseCustomCenterDotColor = true; + //SelectedProfile.Sniper.CenterDotColor.R = Colors[4].R; SelectedProfile.Sniper.CenterDotColor.G = Colors[4].G; SelectedProfile.Sniper.CenterDotColor.B = Colors[4].B; SelectedProfile.Sniper.CenterDotColor.A = Colors[4].A; + SelectedProfile.Sniper.centerDotColorCustom.R = Colors[4].R; SelectedProfile.Sniper.centerDotColorCustom.G = Colors[4].G; SelectedProfile.Sniper.centerDotColorCustom.B = Colors[4].B; SelectedProfile.Sniper.centerDotColorCustom.A = Colors[4].A; return UserSettings; } @@ -29,33 +36,53 @@ public static Data ChangeActiveProfile(List Colors, int SelectedIndex, Da try { Stringsetting activeProfileColor = UserSettings.stringSettings.First(setting => setting.settingEnum == "EAresStringSettingName::CrosshairColor"); - activeProfileColor.value = Utilities.Utils.ColorToString(Colors[0]); + activeProfileColor.value = Utilities.Utils.ColorToString(WhiteColor); } catch { Utilities.Utils.Log("User has no entry for CrosshairColor, Creating one..."); - UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairColor", value = Utilities.Utils.ColorToString(Colors[0]) }); + UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairColor", value = Utilities.Utils.ColorToString(WhiteColor) }); } finally { var SelectedProfile = FetchedProfiles.Profiles[SelectedIndex]; if (!SelectedProfile.bUseAdvancedOptions) SelectedProfile.bUseAdvancedOptions = true; Utilities.Utils.Log("Removing Old colors."); - UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairSniperCenterDotColor"); - UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSColor"); + UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairColorCustom"); UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairOutlineColor"); + //UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSColor"); + UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSColorCustom"); UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSOutlineColor"); + //UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairSniperCenterDotColor"); + UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairSniperCenterDotColorCustom"); + + UserSettings.boolSettings.RemoveAll(setting => setting.settingEnum == "EAresBoolSettingName::CrosshairUseCustomColor"); + UserSettings.boolSettings.RemoveAll(setting => setting.settingEnum == "EAresBoolSettingName::CrosshairADSUseCustomColor"); + UserSettings.boolSettings.RemoveAll(setting => setting.settingEnum == "EAresBoolSettingName::CrosshairSniperUseCustomColor"); Utilities.Utils.Log("Appending new colors."); - UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairSniperCenterDotColor", value = Utilities.Utils.ColorToString(Colors[4]) }); - UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSColor", value = Utilities.Utils.ColorToString(Colors[2]) }); + UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairColorCustom", value = Utilities.Utils.ColorToString(Colors[0]) }); UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairOutlineColor", value = Utilities.Utils.ColorToString(Colors[1]) }); + //UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSColor", value = Utilities.Utils.ColorToString(Colors[2]) }); + UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSColorCustom", value = Utilities.Utils.ColorToString(Colors[2]) }); UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSOutlineColor", value = Utilities.Utils.ColorToString(Colors[3]) }); + //UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairSniperCenterDotColor", value = Utilities.Utils.ColorToString(Colors[4]) }); + UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairSniperCenterDotColorCustom", value = Utilities.Utils.ColorToString(Colors[4]) }); + + UserSettings.boolSettings.Add(new Boolsetting { settingEnum = "EAresBoolSettingName::CrosshairUseCustomColor", value = true }); + UserSettings.boolSettings.Add(new Boolsetting { settingEnum = "EAresBoolSettingName::CrosshairADSUseCustomColor", value = true }); + UserSettings.boolSettings.Add(new Boolsetting { settingEnum = "EAresBoolSettingName::CrosshairSniperUseCustomColor", value = true }); Utilities.Utils.Log("Modifying profile colors."); - SelectedProfile.Primary.Color.R = Colors[0].R; SelectedProfile.Primary.Color.G = Colors[0].G; SelectedProfile.Primary.Color.B = Colors[0].B; SelectedProfile.Primary.Color.A = Colors[0].A; + SelectedProfile.Primary.bUseCustomColor = true; + //SelectedProfile.Primary.Color.R = Colors[0].R; SelectedProfile.Primary.Color.G = Colors[0].G; SelectedProfile.Primary.Color.B = Colors[0].B; SelectedProfile.Primary.Color.A = Colors[0].A; + SelectedProfile.Primary.colorCustom.R = Colors[0].R; SelectedProfile.Primary.colorCustom.G = Colors[0].G; SelectedProfile.Primary.colorCustom.B = Colors[0].B; SelectedProfile.Primary.colorCustom.A = Colors[0].A; SelectedProfile.Primary.OutlineColor.R = Colors[1].R; SelectedProfile.Primary.OutlineColor.G = Colors[1].G; SelectedProfile.Primary.OutlineColor.B = Colors[1].B; SelectedProfile.Primary.OutlineColor.A = Colors[1].A; - SelectedProfile.aDS.Color.R = Colors[2].R; SelectedProfile.aDS.Color.G = Colors[2].G; SelectedProfile.aDS.Color.B = Colors[2].B; SelectedProfile.aDS.Color.A = Colors[2].A; + SelectedProfile.aDS.bUseCustomColor = true; + //SelectedProfile.aDS.Color.R = Colors[2].R; SelectedProfile.aDS.Color.G = Colors[2].G; SelectedProfile.aDS.Color.B = Colors[2].B; SelectedProfile.aDS.Color.A = Colors[2].A; + SelectedProfile.aDS.colorCustom.R = Colors[2].R; SelectedProfile.aDS.colorCustom.G = Colors[2].G; SelectedProfile.aDS.colorCustom.B = Colors[2].B; SelectedProfile.aDS.colorCustom.A = Colors[2].A; SelectedProfile.aDS.OutlineColor.R = Colors[3].R; SelectedProfile.aDS.OutlineColor.G = Colors[3].G; SelectedProfile.aDS.OutlineColor.B = Colors[3].B; SelectedProfile.aDS.OutlineColor.A = Colors[3].A; - SelectedProfile.Sniper.CenterDotColor.R = Colors[4].R; SelectedProfile.Sniper.CenterDotColor.G = Colors[4].G; SelectedProfile.Sniper.CenterDotColor.B = Colors[4].B; SelectedProfile.Sniper.CenterDotColor.A = Colors[4].A; + SelectedProfile.Sniper.bUseCustomCenterDotColor = true; + //SelectedProfile.Sniper.CenterDotColor.R = Colors[4].R; SelectedProfile.Sniper.CenterDotColor.G = Colors[4].G; SelectedProfile.Sniper.CenterDotColor.B = Colors[4].B; SelectedProfile.Sniper.CenterDotColor.A = Colors[4].A; + SelectedProfile.Sniper.centerDotColorCustom.R = Colors[4].R; SelectedProfile.Sniper.centerDotColorCustom.G = Colors[4].G; SelectedProfile.Sniper.centerDotColorCustom.B = Colors[4].B; SelectedProfile.Sniper.centerDotColorCustom.A = Colors[4].A; } return UserSettings; } diff --git a/global.json b/global.json index 5395ff4..fed0a7b 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.101" + "version": "6.0.108" } } \ No newline at end of file