From 9bb50fc6dd8dba7a03f5f4c31b63f41943372ff6 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Fri, 3 Jan 2025 02:36:31 -0600 Subject: [PATCH] misc: improve unpacking error & add nullability to SelectedIcon --- src/Ryujinx.Common/Configuration/DirtyHack.cs | 2 +- src/Ryujinx/AppHost.cs | 2 -- src/Ryujinx/Assets/locales.json | 2 +- src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs | 14 ++++++-------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Ryujinx.Common/Configuration/DirtyHack.cs b/src/Ryujinx.Common/Configuration/DirtyHack.cs index 6e21fe44e..9ab9a26a5 100644 --- a/src/Ryujinx.Common/Configuration/DirtyHack.cs +++ b/src/Ryujinx.Common/Configuration/DirtyHack.cs @@ -25,7 +25,7 @@ namespace Ryujinx.Common.Configuration { var unpackedFields = packedHack.UnpackBitFields(PackedFormat); if (unpackedFields is not [var hack, var value]) - throw new ArgumentException(nameof(packedHack)); + throw new Exception("The unpack operation on the integer resulted in an invalid unpacked result."); return new EnabledDirtyHack((DirtyHack)hack, (int)value); } diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index c728ee9c9..a35a79e86 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -3,7 +3,6 @@ using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Input; using Avalonia.Threading; -using Gommon; using LibHac.Common; using LibHac.Ns; using LibHac.Tools.FsSystem; @@ -43,7 +42,6 @@ using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.SystemState; using Ryujinx.Input; using Ryujinx.Input.HLE; -using Silk.NET.Vulkan; using SkiaSharp; using SPB.Graphics.Vulkan; using System; diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 6f22e7d06..a04bd0538 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -22598,4 +22598,4 @@ } } ] -} +} \ No newline at end of file diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index 1e2a29d21..e11d855a6 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -80,7 +80,9 @@ namespace Ryujinx.Ava.UI.ViewModels [ObservableProperty] private Brush _progressBarForegroundColor; [ObservableProperty] private Brush _progressBarBackgroundColor; [ObservableProperty] private Brush _vSyncModeColor; - [ObservableProperty] private byte[] _selectedIcon; + #nullable enable + [ObservableProperty] private byte[]? _selectedIcon; + #nullable disable [ObservableProperty] private int _statusBarProgressMaximum; [ObservableProperty] private int _statusBarProgressValue; [ObservableProperty] private string _statusBarProgressStatusText; @@ -1754,7 +1756,7 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public async void ProcessTrimResult(String filename, Ryujinx.Common.Utilities.XCIFileTrimmer.OperationOutcome operationOutcome) + public async void ProcessTrimResult(String filename, XCIFileTrimmer.OperationOutcome operationOutcome) { string notifyUser = operationOutcome.ToLocalisedText(); @@ -1769,12 +1771,8 @@ namespace Ryujinx.Ava.UI.ViewModels { switch (operationOutcome) { - case Ryujinx.Common.Utilities.XCIFileTrimmer.OperationOutcome.Successful: - if (Avalonia.Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - if (desktop.MainWindow is MainWindow mainWindow) - mainWindow.LoadApplications(); - } + case XCIFileTrimmer.OperationOutcome.Successful: + RyujinxApp.MainWindow.LoadApplications(); break; } }