From d7e17abade40e85787bfad465121a2e132dc58d7 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Fri, 1 Nov 2024 06:41:02 -0500 Subject: [PATCH] Fix homebrew loading. Fixes #109, #107 --- .../Helper/SetupValidator.cs | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Ryujinx.UI.Common/Helper/SetupValidator.cs b/src/Ryujinx.UI.Common/Helper/SetupValidator.cs index 908476e48..45d9f8f0d 100644 --- a/src/Ryujinx.UI.Common/Helper/SetupValidator.cs +++ b/src/Ryujinx.UI.Common/Helper/SetupValidator.cs @@ -12,18 +12,11 @@ public static class SetupValidator { public static bool IsFirmwareValid(ContentManager contentManager, out UserError error) { - bool hasFirmware = contentManager.GetCurrentFirmwareVersion() != null; + error = contentManager.GetCurrentFirmwareVersion() != null + ? UserError.Success + : UserError.NoFirmware; - if (hasFirmware) - { - error = UserError.Success; - - return true; - } - - error = UserError.NoFirmware; - - return false; + return error is UserError.Success; } public static bool CanFixStartApplication(ContentManager contentManager, string baseApplicationPath, UserError error, out SystemVersion firmwareVersion) @@ -95,14 +88,18 @@ public static bool CanStartApplication(ContentManager contentManager, string bas string baseApplicationExtension = Path.GetExtension(baseApplicationPath).ToLowerInvariant(); // NOTE: We don't force homebrew developers to install a system firmware. - if (baseApplicationExtension is not (".nro" or ".nso")) - return IsFirmwareValid(contentManager, out error); - + if (baseApplicationExtension is ".nro" or ".nso") + { + error = UserError.Success; + return true; + } + + return IsFirmwareValid(contentManager, out error); } error = UserError.ApplicationNotFound; - return error is UserError.Success; + return false; } } }