diff --git a/ValorantCC/src/Modifier.cs b/ValorantCC/src/Modifier.cs index 4ecf846..9b37b19 100644 --- a/ValorantCC/src/Modifier.cs +++ b/ValorantCC/src/Modifier.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Windows.Media; diff --git a/ValorantCC/src/Processor.cs b/ValorantCC/src/Processor.cs index 9eb6dea..eec5eb1 100644 --- a/ValorantCC/src/Processor.cs +++ b/ValorantCC/src/Processor.cs @@ -19,17 +19,18 @@ public class Processor private ProfileList FetchedProfiles; public int CurrentProfile; //Haruki's "bug" fix - private List DefaultColors = new List(); + private Color[] DefaultColors = new Color[8]; public Processor() { - DefaultColors.Add(new Color { R = 0, G = 255, B = 0 }); - DefaultColors.Add(new Color { R = 127, G = 255, B = 0 }); - DefaultColors.Add(new Color { R = 255, G = 255, B = 0 }); - DefaultColors.Add(new Color { R = 0, G = 255, B = 255 }); - DefaultColors.Add(new Color { R = 255, G = 0, B = 255 }); - DefaultColors.Add(new Color { R = 255, G = 0, B = 0 }); - DefaultColors.Add(new Color { R = 255, G = 255, B = 255 }); + DefaultColors[0] = new Color { R = 0, G = 255, B = 0 }; //Green + DefaultColors[1] = new Color { R = 127, G = 255, B = 0 }; //Greenish yellow + DefaultColors[2] = new Color { R = 223, G = 255, B = 0 }; //Yellowish green + DefaultColors[3] = new Color { R = 255, G = 255, B = 0 }; //Yellow + DefaultColors[4] = new Color { R = 0, G = 255, B = 255 }; //Cyan + DefaultColors[5] = new Color { R = 255, G = 0, B = 255 }; //Pink + DefaultColors[6] = new Color { R = 255, G = 0, B = 0 }; //Red + DefaultColors[7] = new Color { R = 255, G = 255, B = 255 }; //White } public async Task Login() @@ -216,29 +217,20 @@ public async Task SaveNewColor(List Colors, int SelectedIndex, stri if (ProfileListed) { Utilities.Utils.Log("Profile type: List"); + SaveListedSettings(Colors, SelectedIndex); + for (int i = 0; i < FetchedProfiles.Profiles.Count; i++) { var item = FetchedProfiles.Profiles[i]; - for (int x = 0; x < DefaultColors.Count; x++) + for (int x = 0; x < DefaultColors.Length; x++) { var color = DefaultColors[x]; - var prfColor = item.Primary.Color; - if (prfColor.R == color.R && prfColor.G == color.G && prfColor.B == color.B) - if (prfColor.R != 0) - prfColor.R--; - else - prfColor.G--; - - prfColor = item.aDS.Color; - if (prfColor.R == color.R && prfColor.G == color.G && prfColor.B == color.B) - if (prfColor.R != 0) - prfColor.R--; - else - prfColor.G--; + CheckDefaultColor(item.Primary.Color, color); + CheckDefaultColor(item.aDS.Color, color); + CheckDefaultColor(item.Sniper.CenterDotColor, color); } } - SaveListedSettings(Colors, SelectedIndex); FetchedProfiles.Profiles[SelectedIndex].ProfileName = ProfileName; Stringsetting SavedProfiles = UserSettings.stringSettings.FirstOrDefault(setting => setting.settingEnum == "EAresStringSettingName::SavedCrosshairProfileData"); SavedProfiles.value = JsonConvert.SerializeObject(FetchedProfiles); @@ -259,5 +251,14 @@ public async Task SaveNewColor(List Colors, int SelectedIndex, stri } return false; } + + private void CheckDefaultColor(CrosshairColor prfColor, Color color) + { + if (prfColor.R == color.R && prfColor.G == color.G && prfColor.B == color.B) + if (prfColor.R != 0) + prfColor.R--; + else + prfColor.G--; + } } }