Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.9.9.46 #790

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Daybreak.GWCA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()
set(VERSION_MAJOR 0)
set(VERSION_MINOR 9)
set(VERSION_PATCH 9)
set(VERSION_TWEAK 44)
set(VERSION_TWEAK 46)

set(VERSION_RC "${CMAKE_CURRENT_BINARY_DIR}/version.rc")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in" "${VERSION_RC}" @ONLY)
Expand Down
4 changes: 2 additions & 2 deletions Daybreak.Tests/Daybreak.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Daybreak/Controls/Templates/GuildwarsPathTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock FontSize="16" Text="Path:" Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" Margin="5" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
<TextBox Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" Background="Transparent" Text="{Binding Path=Path, Mode=TwoWay }"
<TextBox Foreground="{StaticResource MahApps.Brushes.ThemeForeground}" Background="Transparent" Text="{Binding Path=Path, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
BorderThickness="1" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="1"
FontSize="16" Margin="5"
ToolTip="Path to Gw.exe"/>
Expand Down
21 changes: 19 additions & 2 deletions Daybreak/Controls/Templates/GuildwarsPathTemplate.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Core.Extensions;
using System.Data;
using System.Extensions;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
Expand Down Expand Up @@ -71,9 +72,18 @@ protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
}
}

private void ExecutablePath_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
private async void ExecutablePath_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
throw new NotImplementedException();
if (this.DataContext is not ExecutablePath executablePath)
{
return;
}

this.tokenSource?.Cancel();
this.tokenSource?.Dispose();
this.tokenSource = new CancellationTokenSource();
await Task.Delay(1000, this.tokenSource.Token);
this.CheckExecutable();
}

private void BinButton_Clicked(object sender, EventArgs e)
Expand Down Expand Up @@ -106,6 +116,13 @@ private void CheckExecutable()
{
if (this.DataContext is not ExecutablePath executablePath)
{
this.Dispatcher.Invoke(() => this.NoUpdateResult = true);
return;
}

if (!File.Exists(executablePath.Path))
{
this.Dispatcher.Invoke(() => this.NoUpdateResult = true);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Daybreak/Daybreak.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>preview</LangVersion>
<ApplicationIcon>Daybreak.ico</ApplicationIcon>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
<Version>0.9.9.45</Version>
<Version>0.9.9.46</Version>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UserSecretsId>cfb2a489-db80-448d-a969-80270f314c46</UserSecretsId>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
Expand Down
5 changes: 5 additions & 0 deletions Daybreak/Services/ExceptionHandling/ExceptionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public bool HandleException(Exception e)
this.logger.LogError(e, "Failed to initialize browser");
return true;
}
else if (aggregateException.InnerExceptions.FirstOrDefault() is OperationCanceledException)
{
this.logger.LogError(e, "Encountered operation canceled exception");
return true;
}
}
else if (e.Message.Contains("Invalid window handle.") && e.StackTrace?.Contains("CoreWebView2Environment.CreateCoreWebView2ControllerAsync") is true)
{
Expand Down
5 changes: 3 additions & 2 deletions Daybreak/Views/LauncherView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ private void RetrieveLaunchConfigurations()

private async Task PeriodicallyCheckSelectedConfigState()
{
while (this.cancellationTokenSource is not null && !this.cancellationTokenSource.IsCancellationRequested)
while (this.cancellationTokenSource?.Token is CancellationToken token && this.cancellationTokenSource?.IsCancellationRequested is false)
{
if (!this.launching)
{
await this.Dispatcher.InvokeAsync(this.SetLaunchButtonState);
}

await Task.Delay(TimeSpan.FromSeconds(1), this.cancellationTokenSource.Token);
await Task.Delay(TimeSpan.FromSeconds(1), token);
}
}

Expand All @@ -122,6 +122,7 @@ private void StartupView_Loaded(object sender, RoutedEventArgs e)
return;
}

this.cancellationTokenSource?.Dispose();
this.cancellationTokenSource = new CancellationTokenSource();
this.RetrieveLaunchConfigurations();
new TaskFactory().StartNew(this.PeriodicallyCheckSelectedConfigState, this.cancellationTokenSource.Token, TaskCreationOptions.LongRunning, TaskScheduler.Current);
Expand Down
2 changes: 1 addition & 1 deletion GWCA
Submodule GWCA updated from f59455 to f424ed
Loading