Skip to content

Commit

Permalink
Sniper legit color fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Haruki1707 committed Feb 21, 2022
1 parent 29e89d7 commit 6e34513
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
3 changes: 1 addition & 2 deletions ValorantCC/src/Modifier.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;

Expand Down
47 changes: 24 additions & 23 deletions ValorantCC/src/Processor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ public class Processor
private ProfileList FetchedProfiles;
public int CurrentProfile;
//Haruki's "bug" fix
private List<Color> DefaultColors = new List<Color>();
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<AuthResponse> Login()
Expand Down Expand Up @@ -216,29 +217,20 @@ public async Task<bool> SaveNewColor(List<Color> 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);
Expand All @@ -259,5 +251,14 @@ public async Task<bool> SaveNewColor(List<Color> 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--;
}
}
}

0 comments on commit 6e34513

Please # to comment.