diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a1e5175c..3d90d4df2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: env: POWERSHELL_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 - RYUJINX_BASE_VERSION: "1.1.0" + RYUJINX_BASE_VERSION: "1.2.0" jobs: build: diff --git a/.github/workflows/nightly_pr_comment.yml b/.github/workflows/nightly_pr_comment.yml index 38850df06..d1b469ac5 100644 --- a/.github/workflows/nightly_pr_comment.yml +++ b/.github/workflows/nightly_pr_comment.yml @@ -9,7 +9,6 @@ jobs: pr_comment: if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest - timeout-minutes: ${{ fromJSON(vars.JOB_TIMEOUT) }} steps: - uses: actions/github-script@v6 with: @@ -39,24 +38,19 @@ jobs: return core.error(`No artifacts found`); } let body = `Download the artifacts for this pull request:\n`; - let hidden_gtk_artifacts = `\n\n
Old GUI (GTK3)\n`; let hidden_headless_artifacts = `\n\n
GUI-less (SDL2)\n`; let hidden_debug_artifacts = `\n\n
Only for Developers\n`; for (const art of artifacts) { if(art.name.includes('Debug')) { hidden_debug_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; - } else if(art.name.includes('gtk-ryujinx')) { - hidden_gtk_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } else if(art.name.includes('sdl2-ryujinx-headless')) { hidden_headless_artifacts += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } else { body += `\n* [${art.name}](https://nightly.link/${owner}/${repo}/actions/artifacts/${art.id}.zip)`; } } - hidden_gtk_artifacts += `\n
`; hidden_headless_artifacts += `\n
`; hidden_debug_artifacts += `\n
`; - body += hidden_gtk_artifacts; body += hidden_headless_artifacts; body += hidden_debug_artifacts; diff --git a/src/Ryujinx.Common/Pools/ObjectPool.cs b/src/Ryujinx.Common/Pools/ObjectPool.cs index 0b6ce3771..c4610a59c 100644 --- a/src/Ryujinx.Common/Pools/ObjectPool.cs +++ b/src/Ryujinx.Common/Pools/ObjectPool.cs @@ -3,19 +3,11 @@ using System.Threading; namespace Ryujinx.Common { - public class ObjectPool + public class ObjectPool(Func factory, int size) where T : class { private T _firstItem; - private readonly T[] _items; - - private readonly Func _factory; - - public ObjectPool(Func factory, int size) - { - _items = new T[size - 1]; - _factory = factory; - } + private readonly T[] _items = new T[size - 1]; public T Allocate() { @@ -43,7 +35,7 @@ namespace Ryujinx.Common } } - return _factory(); + return factory(); } public void Release(T obj) diff --git a/src/Ryujinx.Common/ReactiveObject.cs b/src/Ryujinx.Common/ReactiveObject.cs index 4831edb52..b25f778fb 100644 --- a/src/Ryujinx.Common/ReactiveObject.cs +++ b/src/Ryujinx.Common/ReactiveObject.cs @@ -47,15 +47,9 @@ namespace Ryujinx.Common } } - public class ReactiveEventArgs + public class ReactiveEventArgs(T oldValue, T newValue) { - public T OldValue { get; } - public T NewValue { get; } - - public ReactiveEventArgs(T oldValue, T newValue) - { - OldValue = oldValue; - NewValue = newValue; - } + public T OldValue { get; } = oldValue; + public T NewValue { get; } = newValue; } } diff --git a/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs b/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs index 7ee9b9e90..5a40433cb 100644 --- a/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs +++ b/src/Ryujinx.HLE/HOS/Applets/Error/ErrorApplet.cs @@ -158,10 +158,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error if (message == "") { - message = "An error has occured.\n\n" - + "Please try again later.\n\n" - + "If the problem persists, please refer to the Ryujinx website.\n" - + "www.ryujinx.org"; + message = "An error has occured.\n\nPlease try again later."; } string[] buttons = GetButtonsText(module, description, "DlgBtn"); diff --git a/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs b/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs index 9a7fdcc16..12c046f56 100644 --- a/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs +++ b/src/Ryujinx.HLE/HOS/Services/Am/AppletOE/ApplicationProxyService/ApplicationProxy/IApplicationFunctions.cs @@ -659,7 +659,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.Applicati if (string.IsNullOrWhiteSpace(filePath)) { - throw new InvalidSystemResourceException("JIT (010000000000003B) system title not found! The JIT will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx#requirements for more information)"); + throw new InvalidSystemResourceException("JIT (010000000000003B) system title not found! The JIT will not work, provide the system archive to fix this error. (See https://github.com/GreemDev/Ryujinx#requirements for more information)"); } context.Device.LoadNca(filePath); diff --git a/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs b/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs index 641795890..ea3bd84df 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sdb/Pl/SharedFontManager.cs @@ -105,7 +105,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pl titleName = "Unknown"; } - throw new InvalidSystemResourceException($"{titleName} ({fontTitle:x8}) system title not found! This font will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx#requirements for more information)"); + throw new InvalidSystemResourceException($"{titleName} ({fontTitle:x8}) system title not found! This font will not work, provide the system archive to fix this error. (See https://github.com/GreemDev/Ryujinx#requirements for more information)"); } } else diff --git a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs index 5d2e06a4f..49becac55 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ssl/BuiltInCertificateManager.cs @@ -23,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl { private const long CertStoreTitleId = 0x0100000000000800; - private const string CertStoreTitleMissingErrorMessage = "CertStore system title not found! SSL CA retrieving will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide#initial-setup-continued---installation-of-firmware for more information)"; + private const string CertStoreTitleMissingErrorMessage = "CertStore system title not found! SSL CA retrieving will not work, provide the system archive to fix this error."; private static BuiltInCertificateManager _instance; diff --git a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs index abf3cd7d6..222698a7f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneContentManager.cs @@ -23,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone { private const long TimeZoneBinaryTitleId = 0x010000000000080E; - private const string TimeZoneSystemTitleMissingErrorMessage = "TimeZoneBinary system title not found! TimeZone conversions will not work, provide the system archive to fix this error. (See https://github.com/Ryujinx/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide#initial-setup-continued---installation-of-firmware for more information)"; + private const string TimeZoneSystemTitleMissingErrorMessage = "TimeZoneBinary system title not found! TimeZone conversions will not work, provide the system archive to fix this error."; private VirtualFileSystem _virtualFileSystem; private IntegrityCheckLevel _fsIntegrityCheckLevel; diff --git a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs index 7ed020319..a1ab356a7 100644 --- a/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs +++ b/src/Ryujinx.UI.Common/Helper/FileAssociationHelper.cs @@ -11,7 +11,7 @@ namespace Ryujinx.UI.Common.Helper { public static partial class FileAssociationHelper { - private static readonly string[] _fileExtensions = { ".nca", ".nro", ".nso", ".nsp", ".xci" }; + private static readonly string[] _fileExtensions = [".nca", ".nro", ".nso", ".nsp", ".xci"]; [SupportedOSPlatform("linux")] private static readonly string _mimeDbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "mime"); diff --git a/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Dark.png b/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Dark.png deleted file mode 100644 index 9a521e3fd..000000000 Binary files a/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Dark.png and /dev/null differ diff --git a/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Light.png b/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Light.png deleted file mode 100644 index 44da0ac45..000000000 Binary files a/src/Ryujinx.UI.Common/Resources/Logo_Patreon_Light.png and /dev/null differ diff --git a/src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png b/src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png index 0e8da15e6..88cf82513 100644 Binary files a/src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png and b/src/Ryujinx.UI.Common/Resources/Logo_Ryujinx.png differ diff --git a/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Dark.png b/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Dark.png deleted file mode 100644 index 66962e7d3..000000000 Binary files a/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Dark.png and /dev/null differ diff --git a/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Light.png b/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Light.png deleted file mode 100644 index 040ca1699..000000000 Binary files a/src/Ryujinx.UI.Common/Resources/Logo_Twitter_Light.png and /dev/null differ diff --git a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj index 980347228..142cd44a5 100644 --- a/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj +++ b/src/Ryujinx.UI.Common/Ryujinx.UI.Common.csproj @@ -18,9 +18,7 @@ - - @@ -39,10 +37,6 @@ - - - - diff --git a/src/Ryujinx.UI.Common/SystemInfo/SystemInfo.cs b/src/Ryujinx.UI.Common/SystemInfo/SystemInfo.cs index 38728b9cf..c50703538 100644 --- a/src/Ryujinx.UI.Common/SystemInfo/SystemInfo.cs +++ b/src/Ryujinx.UI.Common/SystemInfo/SystemInfo.cs @@ -33,17 +33,13 @@ namespace Ryujinx.UI.Common.SystemInfo public static SystemInfo Gather() { if (OperatingSystem.IsWindows()) - { return new WindowsSystemInfo(); - } - else if (OperatingSystem.IsLinux()) - { + + if (OperatingSystem.IsLinux()) return new LinuxSystemInfo(); - } - else if (OperatingSystem.IsMacOS()) - { + + if (OperatingSystem.IsMacOS()) return new MacOSSystemInfo(); - } Logger.Error?.Print(LogClass.Application, "SystemInfo unsupported on this platform"); diff --git a/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs b/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs index bf49c2a66..4a2c8795d 100644 --- a/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs +++ b/src/Ryujinx.UI.Common/SystemInfo/WindowsSystemInfo.cs @@ -40,7 +40,7 @@ namespace Ryujinx.UI.Common.SystemInfo } } - return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").Trim(); + return Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER")?.Trim(); } [StructLayout(LayoutKind.Sequential)] diff --git a/src/Ryujinx/App.axaml.cs b/src/Ryujinx/App.axaml.cs index 24d8a70a1..ec9cd77c7 100644 --- a/src/Ryujinx/App.axaml.cs +++ b/src/Ryujinx/App.axaml.cs @@ -71,8 +71,7 @@ namespace Ryujinx.Ava if (result == UserResult.Yes) { - var path = Environment.ProcessPath; - var proc = Process.Start(path, CommandLineState.Arguments); + _ = Process.Start(Environment.ProcessPath!, CommandLineState.Arguments); desktop.Shutdown(); Environment.Exit(0); } diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 9adf6bca2..ec566a388 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -825,7 +825,7 @@ namespace Ryujinx.Ava { renderer = new VulkanRenderer( Vk.GetApi(), - (RendererHost.EmbeddedWindow as EmbeddedWindowVulkan).CreateSurface, + (RendererHost.EmbeddedWindow as EmbeddedWindowVulkan)!.CreateSurface, VulkanHelper.GetRequiredInstanceExtensions, ConfigurationState.Instance.Graphics.PreferredGpu.Value); } @@ -845,36 +845,39 @@ namespace Ryujinx.Ava Logger.Info?.PrintMsg(LogClass.Gpu, $"Backend Threading ({threadingMode}): {isGALThreaded}"); // Initialize Configuration. - var memoryConfiguration = ConfigurationState.Instance.System.ExpandRam.Value ? MemoryConfiguration.MemoryConfiguration8GiB : MemoryConfiguration.MemoryConfiguration4GiB; + var memoryConfiguration = ConfigurationState.Instance.System.ExpandRam + ? MemoryConfiguration.MemoryConfiguration8GiB + : MemoryConfiguration.MemoryConfiguration4GiB; - HLEConfiguration configuration = new(VirtualFileSystem, - _viewModel.LibHacHorizonManager, - ContentManager, - _accountManager, - _userChannelPersistence, - renderer, - InitializeAudio(), - memoryConfiguration, - _viewModel.UiHandler, - (SystemLanguage)ConfigurationState.Instance.System.Language.Value, - (RegionCode)ConfigurationState.Instance.System.Region.Value, - ConfigurationState.Instance.Graphics.EnableVsync, - ConfigurationState.Instance.System.EnableDockedMode, - ConfigurationState.Instance.System.EnablePtc, - ConfigurationState.Instance.System.EnableInternetAccess, - ConfigurationState.Instance.System.EnableFsIntegrityChecks ? IntegrityCheckLevel.ErrorOnInvalid : IntegrityCheckLevel.None, - ConfigurationState.Instance.System.FsGlobalAccessLogMode, - ConfigurationState.Instance.System.SystemTimeOffset, - ConfigurationState.Instance.System.TimeZone, - ConfigurationState.Instance.System.MemoryManagerMode, - ConfigurationState.Instance.System.IgnoreMissingServices, - ConfigurationState.Instance.Graphics.AspectRatio, - ConfigurationState.Instance.System.AudioVolume, - ConfigurationState.Instance.System.UseHypervisor, - ConfigurationState.Instance.Multiplayer.LanInterfaceId.Value, - ConfigurationState.Instance.Multiplayer.Mode); - - Device = new Switch(configuration); + Device = new Switch(new HLEConfiguration( + VirtualFileSystem, + _viewModel.LibHacHorizonManager, + ContentManager, + _accountManager, + _userChannelPersistence, + renderer, + InitializeAudio(), + memoryConfiguration, + _viewModel.UiHandler, + (SystemLanguage)ConfigurationState.Instance.System.Language.Value, + (RegionCode)ConfigurationState.Instance.System.Region.Value, + ConfigurationState.Instance.Graphics.EnableVsync, + ConfigurationState.Instance.System.EnableDockedMode, + ConfigurationState.Instance.System.EnablePtc, + ConfigurationState.Instance.System.EnableInternetAccess, + ConfigurationState.Instance.System.EnableFsIntegrityChecks ? IntegrityCheckLevel.ErrorOnInvalid : IntegrityCheckLevel.None, + ConfigurationState.Instance.System.FsGlobalAccessLogMode, + ConfigurationState.Instance.System.SystemTimeOffset, + ConfigurationState.Instance.System.TimeZone, + ConfigurationState.Instance.System.MemoryManagerMode, + ConfigurationState.Instance.System.IgnoreMissingServices, + ConfigurationState.Instance.Graphics.AspectRatio, + ConfigurationState.Instance.System.AudioVolume, + ConfigurationState.Instance.System.UseHypervisor, + ConfigurationState.Instance.Multiplayer.LanInterfaceId, + ConfigurationState.Instance.Multiplayer.Mode + ) + ); } private static IHardwareDeviceDriver InitializeAudio() diff --git a/src/Ryujinx/Common/Locale/LocaleExtension.cs b/src/Ryujinx/Common/Locale/LocaleExtension.cs index b5964aa85..e1231d78c 100644 --- a/src/Ryujinx/Common/Locale/LocaleExtension.cs +++ b/src/Ryujinx/Common/Locale/LocaleExtension.cs @@ -6,33 +6,23 @@ using System; namespace Ryujinx.Ava.Common.Locale { - internal class LocaleExtension : MarkupExtension + internal class LocaleExtension(LocaleKeys key) : MarkupExtension { - public LocaleExtension(LocaleKeys key) - { - Key = key; - } - - public LocaleKeys Key { get; } + public LocaleKeys Key { get; } = key; public override object ProvideValue(IServiceProvider serviceProvider) { - LocaleKeys keyToUse = Key; - var builder = new CompiledBindingPathBuilder(); - builder - .Property(new ClrPropertyInfo("Item", - obj => (LocaleManager.Instance[keyToUse]), - null, - typeof(string)), (weakRef, iPropInfo) => - { - return PropertyInfoAccessorFactory.CreateInpcPropertyAccessor(weakRef, iPropInfo); - }); + builder.Property( + new ClrPropertyInfo("Item", + _ => LocaleManager.Instance[Key], + null, + typeof(string) + ), + PropertyInfoAccessorFactory.CreateInpcPropertyAccessor); - var path = builder.Build(); - - var binding = new CompiledBindingExtension(path) + var binding = new CompiledBindingExtension(builder.Build()) { Source = LocaleManager.Instance }; diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 3823de4c2..b555554a3 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -36,7 +36,7 @@ namespace Ryujinx.Ava private const uint MbIconwarning = 0x30; - public static void Main(string[] args) + public static int Main(string[] args) { Version = ReleaseInformation.Version; @@ -51,7 +51,7 @@ namespace Ryujinx.Ava LoggerAdapter.Register(); - BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); + return BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); } public static AppBuilder BuildAvaloniaApp() diff --git a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs index 016fb4842..79a1eacd8 100644 --- a/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs +++ b/src/Ryujinx/UI/Applet/AvaloniaHostUITheme.cs @@ -5,25 +5,15 @@ using System; namespace Ryujinx.Ava.UI.Applet { - class AvaloniaHostUITheme : IHostUITheme + class AvaloniaHostUITheme(MainWindow parent) : IHostUITheme { - public AvaloniaHostUITheme(MainWindow parent) - { - FontFamily = OperatingSystem.IsWindows() && OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000) ? "Segoe UI Variable" : parent.FontFamily.Name; - DefaultBackgroundColor = BrushToThemeColor(parent.Background); - DefaultForegroundColor = BrushToThemeColor(parent.Foreground); - DefaultBorderColor = BrushToThemeColor(parent.BorderBrush); - SelectionBackgroundColor = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionBrush); - SelectionForegroundColor = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionForegroundBrush); - } + public string FontFamily { get; } = OperatingSystem.IsWindows() && OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000) ? "Segoe UI Variable" : parent.FontFamily.Name; - public string FontFamily { get; } - - public ThemeColor DefaultBackgroundColor { get; } - public ThemeColor DefaultForegroundColor { get; } - public ThemeColor DefaultBorderColor { get; } - public ThemeColor SelectionBackgroundColor { get; } - public ThemeColor SelectionForegroundColor { get; } + public ThemeColor DefaultBackgroundColor { get; } = BrushToThemeColor(parent.Background); + public ThemeColor DefaultForegroundColor { get; } = BrushToThemeColor(parent.Foreground); + public ThemeColor DefaultBorderColor { get; } = BrushToThemeColor(parent.BorderBrush); + public ThemeColor SelectionBackgroundColor { get; } = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionBrush); + public ThemeColor SelectionForegroundColor { get; } = BrushToThemeColor(parent.ViewControls.SearchBox.SelectionForegroundBrush); private static ThemeColor BrushToThemeColor(IBrush brush) { diff --git a/src/Ryujinx/UI/Helpers/UserErrorDialog.cs b/src/Ryujinx/UI/Helpers/UserErrorDialog.cs index 9a44b862b..a6ede18ea 100644 --- a/src/Ryujinx/UI/Helpers/UserErrorDialog.cs +++ b/src/Ryujinx/UI/Helpers/UserErrorDialog.cs @@ -1,22 +1,18 @@ using Ryujinx.Ava.Common.Locale; using Ryujinx.UI.Common; -using Ryujinx.UI.Common.Helper; using System.Threading.Tasks; namespace Ryujinx.Ava.UI.Helpers { internal class UserErrorDialog { - private const string SetupGuideUrl = "https://github.com/Ryujinx/Ryujinx/wiki/Ryujinx-Setup-&-Configuration-Guide"; - private static string GetErrorCode(UserError error) { return $"RYU-{(uint)error:X4}"; } - private static string GetErrorTitle(UserError error) - { - return error switch + private static string GetErrorTitle(UserError error) => + error switch { UserError.NoKeys => LocaleManager.Instance[LocaleKeys.UserErrorNoKeys], UserError.NoFirmware => LocaleManager.Instance[LocaleKeys.UserErrorNoFirmware], @@ -25,11 +21,9 @@ namespace Ryujinx.Ava.UI.Helpers UserError.Unknown => LocaleManager.Instance[LocaleKeys.UserErrorUnknown], _ => LocaleManager.Instance[LocaleKeys.UserErrorUndefined], }; - } - private static string GetErrorDescription(UserError error) - { - return error switch + private static string GetErrorDescription(UserError error) => + error switch { UserError.NoKeys => LocaleManager.Instance[LocaleKeys.UserErrorNoKeysDescription], UserError.NoFirmware => LocaleManager.Instance[LocaleKeys.UserErrorNoFirmwareDescription], @@ -38,53 +32,17 @@ namespace Ryujinx.Ava.UI.Helpers UserError.Unknown => LocaleManager.Instance[LocaleKeys.UserErrorUnknownDescription], _ => LocaleManager.Instance[LocaleKeys.UserErrorUndefinedDescription], }; - } - - private static bool IsCoveredBySetupGuide(UserError error) - { - return error switch - { - UserError.NoKeys or - UserError.NoFirmware or - UserError.FirmwareParsingFailed => true, - _ => false, - }; - } - - private static string GetSetupGuideUrl(UserError error) - { - if (!IsCoveredBySetupGuide(error)) - { - return null; - } - - return error switch - { - UserError.NoKeys => SetupGuideUrl + "#initial-setup---placement-of-prodkeys", - UserError.NoFirmware => SetupGuideUrl + "#initial-setup-continued---installation-of-firmware", - _ => SetupGuideUrl, - }; - } public static async Task ShowUserErrorDialog(UserError error) { string errorCode = GetErrorCode(error); - bool isInSetupGuide = IsCoveredBySetupGuide(error); - - string setupButtonLabel = isInSetupGuide ? LocaleManager.Instance[LocaleKeys.OpenSetupGuideMessage] : ""; - - var result = await ContentDialogHelper.CreateInfoDialog( + await ContentDialogHelper.CreateInfoDialog( LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogMessage, errorCode, GetErrorTitle(error)), - GetErrorDescription(error) + (isInSetupGuide - ? LocaleManager.Instance[LocaleKeys.DialogUserErrorDialogInfoMessage] - : ""), setupButtonLabel, LocaleManager.Instance[LocaleKeys.InputDialogOk], + GetErrorDescription(error), + "", + LocaleManager.Instance[LocaleKeys.InputDialogOk], LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogTitle, errorCode)); - - if (result == UserResult.Ok) - { - OpenHelper.OpenUrl(GetSetupGuideUrl(error)); - } } } } diff --git a/src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs index f8fd5b7de..d762606a0 100644 --- a/src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/AboutWindowViewModel.cs @@ -17,11 +17,8 @@ namespace Ryujinx.Ava.UI.ViewModels { private Bitmap _githubLogo; private Bitmap _discordLogo; - private Bitmap _patreonLogo; - private Bitmap _twitterLogo; private string _version; - private string _supporters; public Bitmap GithubLogo { @@ -43,36 +40,6 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public Bitmap PatreonLogo - { - get => _patreonLogo; - set - { - _patreonLogo = value; - OnPropertyChanged(); - } - } - - public Bitmap TwitterLogo - { - get => _twitterLogo; - set - { - _twitterLogo = value; - OnPropertyChanged(); - } - } - - public string Supporters - { - get => _supporters; - set - { - _supporters = value; - OnPropertyChanged(); - } - } - public string Version { get => _version; @@ -83,13 +50,12 @@ namespace Ryujinx.Ava.UI.ViewModels } } - public string Developers => LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.AboutPageDeveloperListMore, "gdkchan, Ac_K, marysaka, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, GoffyDude, TSRBerry, IsaacMarovitz"); + public string Developers => LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.AboutPageDeveloperListMore, "gdkchan, Ac_K, marysaka, rip in peri peri, LDj3SNuD, emmaus, Thealexbarney, GoffyDude, TSRBerry, IsaacMarovitz, GreemDev"); public AboutWindowViewModel() { Version = Program.Version; UpdateLogoTheme(ConfigurationState.Instance.UI.BaseStyle.Value); - Dispatcher.UIThread.InvokeAsync(DownloadPatronsJson); ThemeManager.ThemeChanged += ThemeManager_ThemeChanged; } @@ -108,8 +74,6 @@ namespace Ryujinx.Ava.UI.ViewModels GithubLogo = LoadBitmap($"{basePath}Logo_GitHub_{themeSuffix}?assembly=Ryujinx.UI.Common"); DiscordLogo = LoadBitmap($"{basePath}Logo_Discord_{themeSuffix}?assembly=Ryujinx.UI.Common"); - PatreonLogo = LoadBitmap($"{basePath}Logo_Patreon_{themeSuffix}?assembly=Ryujinx.UI.Common"); - TwitterLogo = LoadBitmap($"{basePath}Logo_Twitter_{themeSuffix}?assembly=Ryujinx.UI.Common"); } private Bitmap LoadBitmap(string uri) @@ -122,28 +86,5 @@ namespace Ryujinx.Ava.UI.ViewModels ThemeManager.ThemeChanged -= ThemeManager_ThemeChanged; GC.SuppressFinalize(this); } - - private async Task DownloadPatronsJson() - { - if (!NetworkInterface.GetIsNetworkAvailable()) - { - Supporters = LocaleManager.Instance[LocaleKeys.ConnectionError]; - - return; - } - - HttpClient httpClient = new(); - - try - { - string patreonJsonString = await httpClient.GetStringAsync("https://patreon.ryujinx.org/"); - - Supporters = string.Join(", ", JsonHelper.Deserialize(patreonJsonString, CommonJsonContext.Default.StringArray)) + "\n\n"; - } - catch - { - Supporters = LocaleManager.Instance[LocaleKeys.ApiError]; - } - } } } diff --git a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs index c9b645a5c..0b7edf1e4 100644 --- a/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/MainWindowViewModel.cs @@ -911,7 +911,8 @@ namespace Ryujinx.Ava.UI.ViewModels public KeyGesture PauseKey { - get => KeyGesture.Parse(_pauseKey); set + get => KeyGesture.Parse(_pauseKey); + set { _pauseKey = value.ToString(); diff --git a/src/Ryujinx/UI/Windows/AboutWindow.axaml b/src/Ryujinx/UI/Windows/AboutWindow.axaml index 69fa82517..16ddb87cb 100644 --- a/src/Ryujinx/UI/Windows/AboutWindow.axaml +++ b/src/Ryujinx/UI/Windows/AboutWindow.axaml @@ -83,18 +83,13 @@ LineHeight="12" Text="{Binding Version}" TextAlignment="Center" /> - + - - - @@ -162,32 +144,6 @@ ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}"> - - @@ -205,7 +161,6 @@ - + Tag="https://github.com/GreemDev/Ryujinx/graphs/contributors?type=a"> - - - - - -