Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
PATCH v3.1.9 (Community Profiles list bug fix & Reload bug fix)
Browse files Browse the repository at this point in the history
Update ValorantCC.csproj

Co-Authored-By: Diego Gómez <72423267+Haruki1707@users.noreply.github.com>
  • Loading branch information
Haruki1707 authored and weedeej committed Mar 17, 2022
1 parent 6a33bcb commit 5ccac08
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ValorantCC/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
</Grid>
</Border>
</Grid>
<Border Width="auto" MinHeight="18" Background="#FF44464F" Margin="-2,2,-2,2">
<Border Width="auto" MinHeight="18" Background="#FF44464F" Margin="-2,2,-2,0">
<DockPanel>
<TextBlock FontWeight="Bold" Margin="6,0,2,2" Foreground="White" FontFamily="Segoe UI Semibold" FontSize="10" Text="Message: "/>
<TextBlock FontWeight="Bold" Margin="0,0,2,2" Foreground="Yellow" FontFamily="Segoe UI Semibold" TextWrapping="Wrap" Name="MessageTxt" FontSize="10" Text="Waiting for Valorant or Riot Client. . ."/>
Expand Down
16 changes: 12 additions & 4 deletions ValorantCC/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ public MainWindow()

InitializeComponent();
Utilities.Utils.Log($"App Started | v{ProgramFileVersion}. Replaced old logfile.");
this.Title = $"ValorantCC v{ProgramFileVersion}";
BackgroundAuth auth = new BackgroundAuth(DataProcessor);
auth.LoopCheck();
Title = $"ValorantCC v{ProgramFileVersion}";
Random nClicks = new Random();
for (int i = 0; i < nClicks.Next(0, Resources.MergedDictionaries[0].Count - 1); i++)
next_Click(null, null);
Expand Down Expand Up @@ -125,6 +123,7 @@ private async void btnReload_Click(object sender, RoutedEventArgs e)

profiles.ItemsSource = DataProcessor.ProfileNames;
profiles.Items.Refresh();
profiles_SelectionChanged(null, null);
profiles.SelectedIndex = DataProcessor.CurrentProfile;
}

Expand Down Expand Up @@ -350,8 +349,15 @@ private async void btnShare_Click(object sender, RoutedEventArgs e)

private async void spinner_Loaded(object sender, RoutedEventArgs e)
{
BackgroundAuth auth = new BackgroundAuth(DataProcessor);

if (Directory.Exists(Path.GetTempPath() + $"EZ_Updater0"))
{
Directory.CreateDirectory(Path.GetTempPath() + $"EZ_Updater0{Updater.OriginalFileName}");
Directory.Delete(Path.GetTempPath() + $"EZ_Updater0");
}

Updater.CustomLogger = Utilities.Utils.Log;
Updater.OriginalFileName = "ValorantCC";
Updater.LogInterfix = " | ";
if (await Updater.CheckUpdateAsync("weedeej", "ValorantCC"))
{
Expand All @@ -365,6 +371,8 @@ private async void spinner_Loaded(object sender, RoutedEventArgs e)
update.Owner = this;
update.ShowDialog();
}

auth.LoopCheck();
}

private void btnCopyShareCode_Click(object sender, RoutedEventArgs e)
Expand Down
9 changes: 6 additions & 3 deletions ValorantCC/SubWindow/ProfilesWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ private async Task<bool> InitialFetch(String sharecode = null, bool ClearArrays
ShareableProfile currentShareable = Shareables[i];
CrosshairProfile profile;
profile = JsonConvert.DeserializeObject<CrosshairProfile>(Regex.Unescape(currentShareable.settings));
PublicProfiles.Add(new PublicProfile() { owner = currentShareable.displayName, settings = profile, sharecode = currentShareable.shareCode, ID = i });
int id = i;
if (!ClearArrays)
id += _offset;
PublicProfiles.Add(new PublicProfile() { owner = currentShareable.displayName, settings = profile, sharecode = currentShareable.shareCode, ID = id });
}
btnSearchCode.IsEnabled = true;
return true;
Expand Down Expand Up @@ -181,8 +184,8 @@ public void applyBtnClicked(object sender, RoutedEventArgs e)
Utilities.Utils.Log("Apply button clicked.");
PublicProfile pressedPubProfile = PublicProfiles[Int32.Parse(((Button)sender).Name.Split('_')[1])];
CrosshairProfile pressedProfile = pressedPubProfile.settings;
selected.aDS = pressedProfile.aDS;
selected.Primary = pressedProfile.Primary;
selected.aDS = pressedProfile.aDS;
selected.Sniper = pressedProfile.Sniper;
selected.bUseAdvancedOptions = pressedProfile.bUseAdvancedOptions;
selected.bUseCustomCrosshairOnAllPrimary = pressedProfile.bUseCustomCrosshairOnAllPrimary;
Expand Down Expand Up @@ -236,7 +239,7 @@ private async void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventA
var ScrollPercentage = ((MaxHeight - ScrollContainer.VerticalOffset) / MaxHeight) *100;
var MaxScrollPercentage = 12 - .025*_offset;
if(MaxScrollPercentage <= 0) MaxScrollPercentage = .5;
System.Diagnostics.Trace.WriteLine(ScrollPercentage);
//System.Diagnostics.Trace.WriteLine(ScrollPercentage);
if (ScrollPercentage < MaxScrollPercentage && !AlreadyFetching)
{
AlreadyFetching = true;
Expand Down
10 changes: 5 additions & 5 deletions ValorantCC/SubWindow/UpdateWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ValorantCC"
mc:Ignorable="d"
Title="UpdateWindow" Height="126" Width="395" Background="#FF232429" WindowStyle="None" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False">
<Border BorderBrush="White" BorderThickness="1">
<StackPanel VerticalAlignment="Center">
Title="UpdateWindow" Height="104" Width="899" Background="#FF232429" WindowStyle="None" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" Closing="Window_Closing">
<Border BorderBrush="White" BorderThickness="0">
<StackPanel VerticalAlignment="Center" Loaded="StackPanel_Loaded">
<Label x:Name="Messagelbl" Content="Downloading Update..." Foreground="White" FontSize="18" HorizontalContentAlignment="Center"/>
<ProgressBar x:Name="progressBar1" Height="21" Margin="0,0,0,5" Width="368"/>
<Button x:Name="OKbtn" Style="{DynamicResource RoundButton}" Content="Confirm" Click="OKbtn_Click" Cursor="Hand" Height="22" Width="84" Background="#FF295FFE" FontFamily="Quicksand" FontSize="14" FontWeight="DemiBold" TextBlock.FontFamily="Segoe UI Semibold" TextBlock.FontWeight="Bold" Margin="0,0,0,0"/>
<ProgressBar x:Name="progressBar1" Height="21" Margin="0,0,0,5" Width="850"/>
<Button x:Name="OKbtn" Style="{DynamicResource RoundButton}" Content="Confirm" Click="OKbtn_Click" Cursor="Hand" Height="22" Width="84" Background="#FF295FFE" FontFamily="Quicksand" FontSize="14" FontWeight="DemiBold" TextBlock.FontFamily="Segoe UI Semibold" TextBlock.FontWeight="Bold" Margin="0,4,0,0"/>
</StackPanel>
</Border>
</Window>
15 changes: 15 additions & 0 deletions ValorantCC/SubWindow/UpdateWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace ValorantCC
{
public partial class UpdateWindow : Window
{
private bool _OKpressed = false;

public UpdateWindow()
{
InitializeComponent();
Expand All @@ -31,9 +33,22 @@ private void UIChange(object sender, EventArgs e)
}
}

private void StackPanel_Loaded(object sender, RoutedEventArgs e)
{
UpdateLayout();
Top = Top + 14;
}

private void OKbtn_Click(object sender, RoutedEventArgs e)
{
_OKpressed = true;
Close();
}

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (!_OKpressed)
e.Cancel = true;
}
}
}
5 changes: 3 additions & 2 deletions ValorantCC/ValorantCC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<AssemblyVersion></AssemblyVersion>
<FileVersion></FileVersion>
<Version>3.1.8</Version>
<Version>3.1.9</Version>
<SignAssembly>true</SignAssembly>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -75,7 +76,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="EZ_Updater" Version="0.5.2" />
<PackageReference Include="EZ_Updater" Version="0.5.3.1" />
<PackageReference Include="FontAwesome.WPF" Version="4.7.0.9" />
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
9 changes: 5 additions & 4 deletions ValorantCC/src/BackgroundAuth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ class BackgroundAuth
public BackgroundAuth(Processor processor1)
{
processor = processor1;
main.ch_display.Visibility = Visibility.Collapsed;
main.buttons_group.Visibility = Visibility.Collapsed;
main.controls_group.Visibility = Visibility.Collapsed;
main.ForceLoginBtn.Visibility = Visibility.Collapsed;
}
public async void LoopCheck()
{
string LockfilePath = Environment.GetEnvironmentVariable("LocalAppData") + "\\Riot Games\\Riot Client\\Config\\lockfile"; //Copy pasted from Auth.cs because why not?
bool lockfilexists = false;
int FlagExistsCount = 0;
main.ch_display.Visibility = Visibility.Collapsed;
main.buttons_group.Visibility = Visibility.Collapsed;
main.controls_group.Visibility = Visibility.Collapsed;
main.ForceLoginBtn.Visibility = Visibility.Collapsed;

while (true)
{
if (AuthObj.CheckLockFile(LockfilePath) && !lockfilexists)
Expand Down

0 comments on commit 5ccac08

Please sign in to comment.