diff --git a/ValorantCC/SubWindow/ProfilesWindow.xaml b/ValorantCC/SubWindow/ProfilesWindow.xaml
index deed021..4ae1b5a 100644
--- a/ValorantCC/SubWindow/ProfilesWindow.xaml
+++ b/ValorantCC/SubWindow/ProfilesWindow.xaml
@@ -1,4 +1,4 @@
-
+ Title=""
+ RenderOptions.BitmapScalingMode="Fant"
+ AllowsTransparency="True"
+ Height="481" Width="339"
+ ResizeMode="NoResize"
+ SizeToContent="WidthAndHeight"
+ ShowInTaskbar="False"
+ WindowTitleBrush="#232429"
+ GlowBrush="White"
+ WindowStartupLocation="CenterOwner" WindowStyle="None" WindowState="Normal" Icon="../Resources/vtools-colored.ico">
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
An error has occured while fetching profiles.
@@ -40,4 +35,4 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/ValorantCC/SubWindow/ProfilesWindow.xaml.cs b/ValorantCC/SubWindow/ProfilesWindow.xaml.cs
index 47e266d..3a4e638 100644
--- a/ValorantCC/SubWindow/ProfilesWindow.xaml.cs
+++ b/ValorantCC/SubWindow/ProfilesWindow.xaml.cs
@@ -1,4 +1,5 @@
-using Newtonsoft.Json;
+using MahApps.Metro.Controls;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
@@ -22,7 +23,7 @@ public struct PublicProfile
public int ID { get; set; }
}
- public partial class ProfilesWindow : Window
+ public partial class ProfilesWindow : MetroWindow
{
public CrosshairProfile selected;
private static API ValCCApi;
diff --git a/ValorantCC/SubWindow/src/CreateRender.cs b/ValorantCC/SubWindow/src/CreateRender.cs
index 343423f..e44ec2c 100644
--- a/ValorantCC/SubWindow/src/CreateRender.cs
+++ b/ValorantCC/SubWindow/src/CreateRender.cs
@@ -45,7 +45,7 @@ public static async Task GenerateRender(this ProfilesWindow profilesW
MaxHeight = 95,
MinWidth = 300,
MaxWidth = 300,
- Margin = new Thickness(5, 5, 0, 0)
+ Margin = new Thickness(5, 10, 0, 0)
};
// First Grid and defintions
diff --git a/ValorantCC/src/BackgroundAuth.cs b/ValorantCC/src/BackgroundAuth.cs
index 490a6d2..3e26401 100644
--- a/ValorantCC/src/BackgroundAuth.cs
+++ b/ValorantCC/src/BackgroundAuth.cs
@@ -80,10 +80,11 @@ public async void LoopCheck()
public async static Task LoginFlagExists()
{
- String LogDir = Environment.GetEnvironmentVariable("LocalAppData") + "\\Riot Games\\Riot Client\\Logs\\Riot Client Logs";
- String[] logs = Directory.GetFiles(LogDir, "*.log");
+ DirectoryInfo LogDir = new DirectoryInfo(Environment.GetEnvironmentVariable("LocalAppData") + "\\Riot Games\\Riot Client\\Logs\\Riot Client Logs");
+ var log = LogDir.GetFiles().OrderByDescending(f => f.LastWriteTime).First();
+
string content;
- using (FileStream fileStream = File.Open(logs.Last(), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+ using (FileStream fileStream = File.Open(log.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
using (StreamReader sr = new StreamReader(fileStream))
{
diff --git a/ValorantCC/src/Binder.cs b/ValorantCC/src/Binder.cs
index ca9ec4c..9a8ca5b 100644
--- a/ValorantCC/src/Binder.cs
+++ b/ValorantCC/src/Binder.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
namespace ValorantCC
{
public partial class Actionmapping
@@ -72,12 +73,17 @@ public partial class SniperSettings
public float CenterDotOpacity { get; set; }
public bool bDisplayCenterDot { get; set; }
}
- public partial class CrosshairColor
+ public partial class CrosshairColor : ICloneable
{
public byte R { get; set; }
public byte G { get; set; }
public byte B { get; set; }
public byte A { get; set; }
+
+ public object Clone()
+ {
+ throw new NotImplementedException();
+ }
}
public partial class LineSettings
diff --git a/ValorantCC/src/Modifier.cs b/ValorantCC/src/Modifier.cs
index 373af5b..4ecf846 100644
--- a/ValorantCC/src/Modifier.cs
+++ b/ValorantCC/src/Modifier.cs
@@ -15,24 +15,27 @@ public static Data ChangeActiveProfile(List Colors, int SelectedIndex, Da
Stringsetting activeProfileColor = UserSettings.stringSettings.First(setting => setting.settingEnum == "EAresStringSettingName::CrosshairColor");
activeProfileColor.value = Utilities.Utils.ColorToString(Colors[0]);
}
- catch (ArgumentNullException)
+ 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]) });
}
- if (FetchedProfiles.Profiles[SelectedIndex].bUseAdvancedOptions)
+ finally
{
- 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::CrosshairOutlineColor");
- UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSOutlineColor");
+ if (FetchedProfiles.Profiles[SelectedIndex].bUseAdvancedOptions)
+ {
+ 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::CrosshairOutlineColor");
+ UserSettings.stringSettings.RemoveAll(setting => setting.settingEnum == "EAresStringSettingName::CrosshairADSOutlineColor");
+ }
+ 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::CrosshairOutlineColor", value = Utilities.Utils.ColorToString(Colors[1]) });
+ UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSOutlineColor", value = Utilities.Utils.ColorToString(Colors[3]) });
}
- 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::CrosshairOutlineColor", value = Utilities.Utils.ColorToString(Colors[1]) });
- UserSettings.stringSettings.Add(new Stringsetting { settingEnum = "EAresStringSettingName::CrosshairADSOutlineColor", value = Utilities.Utils.ColorToString(Colors[3]) });
return UserSettings;
}
}
diff --git a/ValorantCC/src/Processor.cs b/ValorantCC/src/Processor.cs
index 0768f7f..9eb6dea 100644
--- a/ValorantCC/src/Processor.cs
+++ b/ValorantCC/src/Processor.cs
@@ -214,31 +214,31 @@ public async Task SaveNewColor(List Colors, int SelectedIndex, stri
Utilities.Utils.Log("Save button clicked. Saving...");
if (ProfileListed)
- SaveListedSettings(Colors, SelectedIndex);
-
- foreach (var item in FetchedProfiles.Profiles)
{
- foreach (var color in DefaultColors)
+ Utilities.Utils.Log("Profile type: List");
+ for (int i = 0; i < FetchedProfiles.Profiles.Count; i++)
{
- 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--;
+ var item = FetchedProfiles.Profiles[i];
+ for (int x = 0; x < DefaultColors.Count; 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--;
+ 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--;
+ }
}
- }
- if (ProfileListed)
- {
- Utilities.Utils.Log("Profile type: List");
+ SaveListedSettings(Colors, SelectedIndex);
FetchedProfiles.Profiles[SelectedIndex].ProfileName = ProfileName;
Stringsetting SavedProfiles = UserSettings.stringSettings.FirstOrDefault(setting => setting.settingEnum == "EAresStringSettingName::SavedCrosshairProfileData");
SavedProfiles.value = JsonConvert.SerializeObject(FetchedProfiles);
@@ -247,9 +247,9 @@ public async Task SaveNewColor(List Colors, int SelectedIndex, stri
{
Utilities.Utils.Log("Profile type: Enum");
Stringsetting profileName = UserSettings.stringSettings.FirstOrDefault(setting => setting.settingEnum == "EAresStringSettingName::CrosshairProfileName");
- Stringsetting SavedProfile = UserSettings.stringSettings.FirstOrDefault(setting => setting.settingEnum == "EAresStringSettingName::CrosshairColor");
- SavedProfile.value = Utilities.Utils.ColorToString(Colors[0]);
+ UserSettings = Modifier.ChangeActiveProfile(Colors, SelectedIndex, UserSettings, FetchedProfiles);
profileName.value = ProfileName;
+
}
if (await putUserSettings(UserSettings))
{