From 24f69eb5a6c88887cac675fb471e1425afe5f48f Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Tue, 24 Aug 2021 10:20:42 +1000 Subject: [PATCH] Also check PreferredPlatformsForExtensions for single-file archives resolves #2915 --- src/BizHawk.Client.Common/RomLoader.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/BizHawk.Client.Common/RomLoader.cs b/src/BizHawk.Client.Common/RomLoader.cs index 1d350bf969..28ab9c4003 100644 --- a/src/BizHawk.Client.Common/RomLoader.cs +++ b/src/BizHawk.Client.Common/RomLoader.cs @@ -199,6 +199,14 @@ namespace BizHawk.Client.Common { file.BindSoleItemOf(RomFileExtensions.AutoloadFromArchive); } + // ...including unrecognised extensions that the user has set a platform for + if (!file.IsBound) + { + var exts = _config.PreferredPlatformsForExtensions.Where(static kvp => !string.IsNullOrEmpty(kvp.Value)) + .Select(static kvp => kvp.Key) + .ToList(); + if (exts.Count is not 0) file.BindSoleItemOf(exts); + } // if we have an archive and need to bind something, then pop the dialog if (file.IsArchive && !file.IsBound)