From 14008fbcb0a6cc65109619e1241f905c1d41839b Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 14 Dec 2014 02:13:06 +0000 Subject: [PATCH] don't show a "No core could load a rom" nag if the user cancels out of the platform chooser --- BizHawk.Client.Common/RomLoader.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/BizHawk.Client.Common/RomLoader.cs b/BizHawk.Client.Common/RomLoader.cs index aef0012cde..eec4cbf4e4 100644 --- a/BizHawk.Client.Common/RomLoader.cs +++ b/BizHawk.Client.Common/RomLoader.cs @@ -154,6 +154,8 @@ namespace BizHawk.Client.Common public bool LoadRom(string path, CoreComm nextComm, bool forceAccurateCore = false) // forceAccurateCore is currently just for Quicknes vs Neshawk but could be used for other situations { + bool cancel = false; + if (path == null) { return false; @@ -321,7 +323,15 @@ namespace BizHawk.Client.Common } else if (ChoosePlatform != null) { - rom.GameInfo.System = ChoosePlatform(rom); + var result = ChoosePlatform(rom); + if (!string.IsNullOrEmpty(result)) + { + rom.GameInfo.System = ChoosePlatform(rom); + } + else + { + cancel = true; + } } } @@ -434,7 +444,10 @@ namespace BizHawk.Client.Common if (nextEmulator == null) { - DoLoadErrorCallback("No core could load the rom.", null); + if (!cancel) + { + DoLoadErrorCallback("No core could load the rom.", null); + } return false; } }