Skip to content

Commit 5ccac08

Browse files
Haruki1707weedeej
authored andcommitted
PATCH v3.1.9 (Community Profiles list bug fix & Reload bug fix)
Update ValorantCC.csproj Co-Authored-By: Diego Gómez <72423267+Haruki1707@users.noreply.github.com>
1 parent 6a33bcb commit 5ccac08

7 files changed

+47
-19
lines changed

ValorantCC/MainWindow.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
</Grid>
249249
</Border>
250250
</Grid>
251-
<Border Width="auto" MinHeight="18" Background="#FF44464F" Margin="-2,2,-2,2">
251+
<Border Width="auto" MinHeight="18" Background="#FF44464F" Margin="-2,2,-2,0">
252252
<DockPanel>
253253
<TextBlock FontWeight="Bold" Margin="6,0,2,2" Foreground="White" FontFamily="Segoe UI Semibold" FontSize="10" Text="Message: "/>
254254
<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. . ."/>

ValorantCC/MainWindow.xaml.cs

+12-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public MainWindow()
3838

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

126124
profiles.ItemsSource = DataProcessor.ProfileNames;
127125
profiles.Items.Refresh();
126+
profiles_SelectionChanged(null, null);
128127
profiles.SelectedIndex = DataProcessor.CurrentProfile;
129128
}
130129

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

351350
private async void spinner_Loaded(object sender, RoutedEventArgs e)
352351
{
352+
BackgroundAuth auth = new BackgroundAuth(DataProcessor);
353+
354+
if (Directory.Exists(Path.GetTempPath() + $"EZ_Updater0"))
355+
{
356+
Directory.CreateDirectory(Path.GetTempPath() + $"EZ_Updater0{Updater.OriginalFileName}");
357+
Directory.Delete(Path.GetTempPath() + $"EZ_Updater0");
358+
}
359+
353360
Updater.CustomLogger = Utilities.Utils.Log;
354-
Updater.OriginalFileName = "ValorantCC";
355361
Updater.LogInterfix = " | ";
356362
if (await Updater.CheckUpdateAsync("weedeej", "ValorantCC"))
357363
{
@@ -365,6 +371,8 @@ private async void spinner_Loaded(object sender, RoutedEventArgs e)
365371
update.Owner = this;
366372
update.ShowDialog();
367373
}
374+
375+
auth.LoopCheck();
368376
}
369377

370378
private void btnCopyShareCode_Click(object sender, RoutedEventArgs e)

ValorantCC/SubWindow/ProfilesWindow.xaml.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ private async Task<bool> InitialFetch(String sharecode = null, bool ClearArrays
109109
ShareableProfile currentShareable = Shareables[i];
110110
CrosshairProfile profile;
111111
profile = JsonConvert.DeserializeObject<CrosshairProfile>(Regex.Unescape(currentShareable.settings));
112-
PublicProfiles.Add(new PublicProfile() { owner = currentShareable.displayName, settings = profile, sharecode = currentShareable.shareCode, ID = i });
112+
int id = i;
113+
if (!ClearArrays)
114+
id += _offset;
115+
PublicProfiles.Add(new PublicProfile() { owner = currentShareable.displayName, settings = profile, sharecode = currentShareable.shareCode, ID = id });
113116
}
114117
btnSearchCode.IsEnabled = true;
115118
return true;
@@ -181,8 +184,8 @@ public void applyBtnClicked(object sender, RoutedEventArgs e)
181184
Utilities.Utils.Log("Apply button clicked.");
182185
PublicProfile pressedPubProfile = PublicProfiles[Int32.Parse(((Button)sender).Name.Split('_')[1])];
183186
CrosshairProfile pressedProfile = pressedPubProfile.settings;
184-
selected.aDS = pressedProfile.aDS;
185187
selected.Primary = pressedProfile.Primary;
188+
selected.aDS = pressedProfile.aDS;
186189
selected.Sniper = pressedProfile.Sniper;
187190
selected.bUseAdvancedOptions = pressedProfile.bUseAdvancedOptions;
188191
selected.bUseCustomCrosshairOnAllPrimary = pressedProfile.bUseCustomCrosshairOnAllPrimary;
@@ -236,7 +239,7 @@ private async void ScrollViewer_ScrollChanged(object sender, ScrollChangedEventA
236239
var ScrollPercentage = ((MaxHeight - ScrollContainer.VerticalOffset) / MaxHeight) *100;
237240
var MaxScrollPercentage = 12 - .025*_offset;
238241
if(MaxScrollPercentage <= 0) MaxScrollPercentage = .5;
239-
System.Diagnostics.Trace.WriteLine(ScrollPercentage);
242+
//System.Diagnostics.Trace.WriteLine(ScrollPercentage);
240243
if (ScrollPercentage < MaxScrollPercentage && !AlreadyFetching)
241244
{
242245
AlreadyFetching = true;

ValorantCC/SubWindow/UpdateWindow.xaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:ValorantCC"
77
mc:Ignorable="d"
8-
Title="UpdateWindow" Height="126" Width="395" Background="#FF232429" WindowStyle="None" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False">
9-
<Border BorderBrush="White" BorderThickness="1">
10-
<StackPanel VerticalAlignment="Center">
8+
Title="UpdateWindow" Height="104" Width="899" Background="#FF232429" WindowStyle="None" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" Closing="Window_Closing">
9+
<Border BorderBrush="White" BorderThickness="0">
10+
<StackPanel VerticalAlignment="Center" Loaded="StackPanel_Loaded">
1111
<Label x:Name="Messagelbl" Content="Downloading Update..." Foreground="White" FontSize="18" HorizontalContentAlignment="Center"/>
12-
<ProgressBar x:Name="progressBar1" Height="21" Margin="0,0,0,5" Width="368"/>
13-
<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"/>
12+
<ProgressBar x:Name="progressBar1" Height="21" Margin="0,0,0,5" Width="850"/>
13+
<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"/>
1414
</StackPanel>
1515
</Border>
1616
</Window>

ValorantCC/SubWindow/UpdateWindow.xaml.cs

+15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace ValorantCC
77
{
88
public partial class UpdateWindow : Window
99
{
10+
private bool _OKpressed = false;
11+
1012
public UpdateWindow()
1113
{
1214
InitializeComponent();
@@ -31,9 +33,22 @@ private void UIChange(object sender, EventArgs e)
3133
}
3234
}
3335

36+
private void StackPanel_Loaded(object sender, RoutedEventArgs e)
37+
{
38+
UpdateLayout();
39+
Top = Top + 14;
40+
}
41+
3442
private void OKbtn_Click(object sender, RoutedEventArgs e)
3543
{
44+
_OKpressed = true;
3645
Close();
3746
}
47+
48+
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
49+
{
50+
if (!_OKpressed)
51+
e.Cancel = true;
52+
}
3853
}
3954
}

ValorantCC/ValorantCC.csproj

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
1515
<AssemblyVersion></AssemblyVersion>
1616
<FileVersion></FileVersion>
17-
<Version>3.1.8</Version>
17+
<Version>3.1.9</Version>
1818
<SignAssembly>true</SignAssembly>
19+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
1920
</PropertyGroup>
2021

2122
<ItemGroup>
@@ -75,7 +76,7 @@
7576
</ItemGroup>
7677

7778
<ItemGroup>
78-
<PackageReference Include="EZ_Updater" Version="0.5.2" />
79+
<PackageReference Include="EZ_Updater" Version="0.5.3.1" />
7980
<PackageReference Include="FontAwesome.WPF" Version="4.7.0.9" />
8081
<PackageReference Include="MahApps.Metro" Version="2.4.9" />
8182
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />

ValorantCC/src/BackgroundAuth.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ class BackgroundAuth
2424
public BackgroundAuth(Processor processor1)
2525
{
2626
processor = processor1;
27+
main.ch_display.Visibility = Visibility.Collapsed;
28+
main.buttons_group.Visibility = Visibility.Collapsed;
29+
main.controls_group.Visibility = Visibility.Collapsed;
30+
main.ForceLoginBtn.Visibility = Visibility.Collapsed;
2731
}
2832
public async void LoopCheck()
2933
{
3034
string LockfilePath = Environment.GetEnvironmentVariable("LocalAppData") + "\\Riot Games\\Riot Client\\Config\\lockfile"; //Copy pasted from Auth.cs because why not?
3135
bool lockfilexists = false;
3236
int FlagExistsCount = 0;
33-
main.ch_display.Visibility = Visibility.Collapsed;
34-
main.buttons_group.Visibility = Visibility.Collapsed;
35-
main.controls_group.Visibility = Visibility.Collapsed;
36-
main.ForceLoginBtn.Visibility = Visibility.Collapsed;
37+
3738
while (true)
3839
{
3940
if (AuthObj.CheckLockFile(LockfilePath) && !lockfilexists)

0 commit comments

Comments
 (0)