Skip to content

Commit

Permalink
misc: improve unpacking error & add nullability to SelectedIcon
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Jan 4, 2025
1 parent e956864 commit 9bb50fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Ryujinx.Common/Configuration/DirtyHack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static EnabledDirtyHack Unpack(ulong packedHack)
{
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);
}
Expand Down
2 changes: 0 additions & 2 deletions src/Ryujinx/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Input;
using Avalonia.Threading;
using Gommon;
using LibHac.Common;
using LibHac.Ns;
using LibHac.Tools.FsSystem;
Expand Down Expand Up @@ -43,7 +42,6 @@
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.Input;
using Ryujinx.Input.HLE;
using Silk.NET.Vulkan;
using SkiaSharp;
using SPB.Graphics.Vulkan;
using System;
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/Assets/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -22598,4 +22598,4 @@
}
}
]
}
}
14 changes: 6 additions & 8 deletions src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public partial class MainWindowViewModel : BaseModel
[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;
Expand Down Expand Up @@ -1754,7 +1756,7 @@ public static async Task PerformanceCheck()
}
}

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();

Expand All @@ -1769,12 +1771,8 @@ await ContentDialogHelper.CreateWarningDialog(
{
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;
}
}
Expand Down

0 comments on commit 9bb50fc

Please sign in to comment.