Avalonia - Couple fixes and improvements (#3451)

* fix updater check crash

* remove line

* reduce cheat window sizes

* enable tiered compilation and r2r

* remove warning on LaunchState

* remove warnings related to tasks

* addressed review

* undo csproj indentation

* fix tabs in axaml file

* remove double line

* remove R2R
This commit is contained in:
Emmanuel Hansen 2022-07-11 22:25:33 +00:00 committed by GitHub
parent 14ae4e276f
commit 7d9a5feccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 141 additions and 80 deletions

View File

@ -23,6 +23,7 @@ using System;
using System.Buffers;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using static LibHac.Fs.ApplicationSaveDataManagement;
using Path = System.IO.Path;
@ -77,8 +78,12 @@ namespace Ryujinx.Ava.Common
if (result.IsFailure())
{
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(
_owner,
string.Format(LocaleManager.Instance["DialogMessageCreateSaveErrorMessage"], result.ToStringWithName()));
});
return false;
}
@ -94,8 +99,11 @@ namespace Ryujinx.Ava.Common
return true;
}
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(_owner,
string.Format(LocaleManager.Instance["DialogMessageFindSaveErrorMessage"], result.ToStringWithName()));
});
return false;
}
@ -137,7 +145,7 @@ namespace Ryujinx.Ava.Common
}
}
public static async void ExtractSection(NcaSectionType ncaSectionType, string titleFilePath,
public static async Task ExtractSection(NcaSectionType ncaSectionType, string titleFilePath,
int programIndex = 0)
{
OpenFolderDialog folderDialog = new() { Title = LocaleManager.Instance["FolderDialogExtractTitle"] };
@ -222,9 +230,9 @@ namespace Ryujinx.Ava.Common
{
Logger.Error?.Print(LogClass.Application,
"Extraction failure. The main NCA was not present in the selected file");
Dispatcher.UIThread.InvokeAsync(() =>
Dispatcher.UIThread.InvokeAsync(async () =>
{
ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]);
await ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]);
});
return;
}
@ -263,9 +271,9 @@ namespace Ryujinx.Ava.Common
{
Logger.Error?.Print(LogClass.Application,
$"LibHac returned error code: {resultCode.Value.ErrorCode}");
Dispatcher.UIThread.InvokeAsync(() =>
Dispatcher.UIThread.InvokeAsync(async () =>
{
ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]);
await ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]);
});
}
else if (resultCode.Value.IsSuccess())
@ -288,9 +296,9 @@ namespace Ryujinx.Ava.Common
}
catch (ArgumentException ex)
{
Dispatcher.UIThread.InvokeAsync(() =>
Dispatcher.UIThread.InvokeAsync(async () =>
{
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
await ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
});
}
}

View File

@ -73,8 +73,11 @@ namespace Ryujinx.Modules
}
catch
{
ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
Logger.Error?.Print(LogClass.Application, "Failed to convert the current Ryujinx version!");
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
});
return;
}
@ -106,7 +109,10 @@ namespace Ryujinx.Modules
{
if (showVersionUpToDate)
{
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
});
}
return;
@ -121,7 +127,10 @@ namespace Ryujinx.Modules
{
if (showVersionUpToDate)
{
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
});
}
return;
@ -131,7 +140,10 @@ namespace Ryujinx.Modules
catch (Exception exception)
{
Logger.Error?.Print(LogClass.Application, exception.Message);
ContentDialogHelper.CreateErrorDialog(mainWindow, LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]);
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(mainWindow, LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]);
});
return;
}
@ -142,8 +154,11 @@ namespace Ryujinx.Modules
}
catch
{
ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from Github!");
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]);
});
return;
}
@ -152,7 +167,10 @@ namespace Ryujinx.Modules
{
if (showVersionUpToDate)
{
ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], "");
});
}
Running = false;
@ -180,10 +198,12 @@ namespace Ryujinx.Modules
_buildSize = -1;
}
}
Dispatcher.UIThread.Post(async () =>
{
// Show a message asking the user if they want to update
UpdaterWindow updateDialog = new(mainWindow, newVersion, _buildUrl);
await updateDialog.ShowDialog(mainWindow);
});
}
private static HttpClient ConstructHttpClient()
@ -522,6 +542,7 @@ namespace Ryujinx.Modules
updateDialog.ButtonBox.IsVisible = true;
}
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
public static bool CanUpdate(bool showWarnings, StyleableWindow parent)
{
#if !DISABLE_UPDATER
@ -577,6 +598,7 @@ namespace Ryujinx.Modules
return false;
#endif
}
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
// NOTE: This method should always reflect the latest build layout.s
private static IEnumerable<string> EnumerateFilesToDelete()

View File

@ -5,8 +5,6 @@
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.0.0-dirty</Version>
<TieredCompilation>false</TieredCompilation>
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
<RootNamespace>Ryujinx.Ava</RootNamespace>
<ApplicationIcon>Ryujinx.ico</ApplicationIcon>

View File

@ -92,7 +92,7 @@ namespace Ryujinx.Ava.Ui.Applet
}
catch (Exception ex)
{
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogMessageDialogErrorExceptionMessage"], ex));
await ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogMessageDialogErrorExceptionMessage"], ex));
dialogCloseEvent.Set();
}
@ -126,7 +126,7 @@ namespace Ryujinx.Ava.Ui.Applet
catch (Exception ex)
{
error = true;
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogSoftwareKeyboardErrorExceptionMessage"], ex));
await ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogSoftwareKeyboardErrorExceptionMessage"], ex));
}
finally
{
@ -181,7 +181,7 @@ namespace Ryujinx.Ava.Ui.Applet
catch (Exception ex)
{
dialogCloseEvent.Set();
ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogErrorAppletErrorExceptionMessage"], ex));
await ContentDialogHelper.CreateErrorDialog(_parent, string.Format(LocaleManager.Instance["DialogErrorAppletErrorExceptionMessage"], ex));
}
});

View File

@ -235,7 +235,7 @@ namespace Ryujinx.Ava.Ui.Controls
return new(mainText, secondaryText);
}
internal static async void CreateUpdaterInfoDialog(StyleableWindow window, string primary, string secondaryText)
internal static async Task CreateUpdaterInfoDialog(StyleableWindow window, string primary, string secondaryText)
{
await ShowContentDialog(
window,
@ -248,7 +248,7 @@ namespace Ryujinx.Ava.Ui.Controls
(int)Symbol.Important);
}
internal static async void ShowNotAvailableMessage(StyleableWindow window)
internal static async Task ShowNotAvailableMessage(StyleableWindow window)
{
// Temporary placeholder for features to be added
await ShowContentDialog(
@ -262,7 +262,7 @@ namespace Ryujinx.Ava.Ui.Controls
(int)Symbol.Important);
}
internal static async void CreateWarningDialog(StyleableWindow window, string primary, string secondaryText)
internal static async Task CreateWarningDialog(StyleableWindow window, string primary, string secondaryText)
{
await ShowContentDialog(
window,
@ -275,7 +275,7 @@ namespace Ryujinx.Ava.Ui.Controls
(int)Symbol.Important);
}
internal static async void CreateErrorDialog(StyleableWindow owner, string errorMessage, string secondaryErrorMessage = "")
internal static async Task CreateErrorDialog(StyleableWindow owner, string errorMessage, string secondaryErrorMessage = "")
{
Logger.Error?.Print(LogClass.Application, errorMessage);

View File

@ -658,7 +658,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
return config;
}
public void LoadProfile()
public async void LoadProfile()
{
if (Device == 0)
{
@ -700,9 +700,9 @@ namespace Ryujinx.Ava.Ui.ViewModels
catch (JsonException) { }
catch (InvalidOperationException)
{
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow,
String.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName));
Logger.Error?.Print(LogClass.Configuration, $"Profile {ProfileName} is incompatible with the current input configuration system.");
await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow,
String.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName));
return;
}
@ -736,7 +736,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (ProfileName == LocaleManager.Instance["ControllerSettingsProfileDefault"])
{
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]);
await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]);
return;
}
@ -769,7 +769,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
else
{
ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]);
await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]);
}
}
}

View File

@ -1047,8 +1047,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
out ulong titleIdNumber))
{
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(_owner,
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
});
return;
}
@ -1155,7 +1158,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
catch (Exception e)
{
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], file.Name, e));
await ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], file.Name, e));
}
}
}
@ -1216,7 +1219,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
catch (Exception e)
{
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], directory.Name, e));
await ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogPPTCDeletionErrorMessage"], directory.Name, e));
}
}
}
@ -1229,7 +1232,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
catch (Exception e)
{
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["ShaderCachePurgeError"], file.Name, e));
await ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["ShaderCachePurgeError"], file.Name, e));
}
}
}
@ -1310,8 +1313,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
out ulong titleIdNumber))
{
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(_owner,
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
});
return;
}
@ -1333,8 +1339,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (!ulong.TryParse(selection.TitleId, NumberStyles.HexNumber, CultureInfo.InvariantCulture,
out ulong titleIdNumber))
{
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(_owner,
LocaleManager.Instance["DialogRyujinxErrorMessage"], LocaleManager.Instance["DialogInvalidTitleIdErrorMessage"]);
});
return;
}
@ -1350,30 +1359,30 @@ namespace Ryujinx.Ava.Ui.ViewModels
ApplicationHelper.OpenSaveDir(in filter, titleId, data.ControlHolder, data.TitleName);
}
private void ExtractLogo()
private async void ExtractLogo()
{
var selection = SelectedApplication;
if (selection != null)
{
ApplicationHelper.ExtractSection(NcaSectionType.Logo, selection.Path);
await ApplicationHelper.ExtractSection(NcaSectionType.Logo, selection.Path);
}
}
private void ExtractRomFs()
private async void ExtractRomFs()
{
var selection = SelectedApplication;
if (selection != null)
{
ApplicationHelper.ExtractSection(NcaSectionType.Data, selection.Path);
await ApplicationHelper.ExtractSection(NcaSectionType.Data, selection.Path);
}
}
private void ExtractExeFs()
private async void ExtractExeFs()
{
var selection = SelectedApplication;
if (selection != null)
{
ApplicationHelper.ExtractSection(NcaSectionType.Code, selection.Path);
await ApplicationHelper.ExtractSection(NcaSectionType.Code, selection.Path);
}
}
@ -1382,7 +1391,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
_owner.Close();
}
private async void HandleFirmwareInstallation(string path)
private async Task HandleFirmwareInstallation(string path)
{
try
{
@ -1392,7 +1401,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (firmwareVersion == null)
{
ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogFirmwareInstallerFirmwareNotFoundErrorMessage"], filename));
await ContentDialogHelper.CreateErrorDialog(_owner, string.Format(LocaleManager.Instance["DialogFirmwareInstallerFirmwareNotFoundErrorMessage"], filename));
return;
}
@ -1457,11 +1466,11 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
catch (Exception ex)
{
Dispatcher.UIThread.InvokeAsync(() =>
Dispatcher.UIThread.InvokeAsync(async () =>
{
waitingDialog.Close();
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
await ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
});
}
finally
@ -1482,7 +1491,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
}
catch (Exception ex)
{
ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
await ContentDialogHelper.CreateErrorDialog(_owner, ex.Message);
}
}
@ -1497,7 +1506,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (file != null && file.Length > 0)
{
HandleFirmwareInstallation(file[0]);
await HandleFirmwareInstallation(file[0]);
}
}
@ -1509,7 +1518,7 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (!string.IsNullOrWhiteSpace(folder))
{
HandleFirmwareInstallation(folder);
await HandleFirmwareInstallation(folder);
}
}
}

View File

@ -1,3 +1,4 @@
using Avalonia.Threading;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Ui.Controls;
using Ryujinx.Ava.Ui.Windows;
@ -141,8 +142,12 @@ namespace Ryujinx.Ava.Ui.ViewModels
if (profile == null)
{
ContentDialogHelper.CreateErrorDialog(_owner,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(_owner,
LocaleManager.Instance["DialogUserProfileDeletionWarningMessage"]);
});
return;
}

View File

@ -7,7 +7,6 @@
xmlns:model="clr-namespace:Ryujinx.Ava.Ui.Models"
xmlns:window="clr-namespace:Ryujinx.Ava.Ui.Windows"
mc:Ignorable="d"
SizeToContent="Height"
Width="500" MinHeight="500" Height="500"
WindowStartupLocation="CenterOwner"
MinWidth="500">
@ -45,6 +44,13 @@
VerticalAlignment="Stretch"
Name="CheatsView"
MinHeight="300">
<TreeView.Styles>
<Styles>
<Style Selector="TreeViewItem:empty /template/ ItemsPresenter">
<Setter Property="IsVisible" Value="False"/>
</Style>
</Styles>
</TreeView.Styles>
<TreeView.DataTemplates>
<TreeDataTemplate DataType="model:CheatsList" ItemsSource="{Binding}">
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
@ -56,9 +62,9 @@
</StackPanel>
</TreeDataTemplate>
<DataTemplate x:DataType="model:CheatModel">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<CheckBox IsChecked="{Binding IsEnabled}" MinWidth="20" />
<TextBlock Text="{Binding CleanName}" />
<StackPanel Orientation="Horizontal" Margin="0" HorizontalAlignment="Left">
<CheckBox IsChecked="{Binding IsEnabled}" Padding="0" Margin="5,0" MinWidth="20" />
<TextBlock Text="{Binding CleanName}" VerticalAlignment="Center" />
</StackPanel>
</DataTemplate>
</TreeView.DataTemplates>

View File

@ -2,6 +2,7 @@ using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using LibHac.Common;
using LibHac.Fs;
using LibHac.Fs.Fsa;
@ -21,6 +22,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Path = System.IO.Path;
namespace Ryujinx.Ava.Ui.Windows
@ -125,15 +127,18 @@ namespace Ryujinx.Ava.Ui.Windows
}
catch (Exception ex)
{
ContentDialogHelper.CreateErrorDialog(this,
Dispatcher.UIThread.InvokeAsync(async () =>
{
await ContentDialogHelper.CreateErrorDialog(this,
string.Format(LocaleManager.Instance[
"DialogDlcLoadNcaErrorMessage"], ex.Message, containerPath));
});
}
return null;
}
private void AddDlc(string path)
private async Task AddDlc(string path)
{
if (!File.Exists(path) || Dlcs.FirstOrDefault(x => x.ContainerPath == path) != null)
{
@ -175,7 +180,7 @@ namespace Ryujinx.Ava.Ui.Windows
if (!containsDlc)
{
ContentDialogHelper.CreateErrorDialog(this, LocaleManager.Instance["DialogDlcNoDlcErrorMessage"]);
await ContentDialogHelper.CreateErrorDialog(this, LocaleManager.Instance["DialogDlcNoDlcErrorMessage"]);
}
}
}
@ -214,7 +219,7 @@ namespace Ryujinx.Ava.Ui.Windows
{
foreach (string file in files)
{
AddDlc(file);
await AddDlc(file);
}
}
}

View File

@ -120,8 +120,6 @@ namespace Ryujinx.Ava.Ui.Windows
InputManager = new InputManager(new AvaloniaKeyboardDriver(this), new SDL2GamepadDriver());
LoadGameList();
CheckLaunchState();
}
_rendererWaitEvent = new AutoResetEvent(false);
@ -451,7 +449,7 @@ namespace Ryujinx.Ava.Ui.Windows
RefreshFirmwareStatus();
}
protected async void CheckLaunchState()
protected void CheckLaunchState()
{
if (ShowKeyErrorOnLoad)
{
@ -470,7 +468,7 @@ namespace Ryujinx.Ava.Ui.Windows
if (ConfigurationState.Instance.CheckUpdatesOnStart.Value && Updater.CanUpdate(false, this))
{
await Updater.BeginParse(this, false).ContinueWith(task =>
Updater.BeginParse(this, false).ContinueWith(task =>
{
Logger.Error?.Print(LogClass.Application, $"Updater Error: {task.Exception}");
}, TaskContinuationOptions.OnlyOnFaulted);
@ -537,6 +535,13 @@ namespace Ryujinx.Ava.Ui.Windows
LoadHotKeys();
}
protected override void OnOpened(EventArgs e)
{
base.OnOpened(e);
CheckLaunchState();
}
public static void UpdateGraphicsConfig()
{
int resScale = ConfigurationState.Instance.Graphics.ResScale;

View File

@ -24,6 +24,7 @@ using System.Text;
using Path = System.IO.Path;
using SpanHelpers = LibHac.Common.SpanHelpers;
using LibHac.Tools.FsSystem;
using Avalonia.Threading;
namespace Ryujinx.Ava.Ui.Windows
{
@ -151,14 +152,20 @@ namespace Ryujinx.Ava.Ui.Windows
}
else
{
ContentDialogHelper.CreateErrorDialog(this,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(this,
LocaleManager.Instance["DialogUpdateAddUpdateErrorMessage"]);
});
}
}
catch (Exception ex)
{
ContentDialogHelper.CreateErrorDialog(this,
Dispatcher.UIThread.Post(async () =>
{
await ContentDialogHelper.CreateErrorDialog(this,
string.Format(LocaleManager.Instance["DialogDlcLoadNcaErrorMessage"], ex.Message, path));
});
}
}
}

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
@ -6,8 +6,6 @@
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.0.0-dirty</Version>
<TieredCompilation>false</TieredCompilation>
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
</PropertyGroup>

View File

@ -6,8 +6,6 @@
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.0.0-dirty</Version>
<TieredCompilation>false</TieredCompilation>
<TieredCompilationQuickJit>false</TieredCompilationQuickJit>
<DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
<!-- As we already provide GTK3 on Windows via GtkSharp.Dependencies this is redundant. -->
<SkipGtkInstall>true</SkipGtkInstall>