Rom Loader - don't call message boxes, use the error callback

This commit is contained in:
adelikat 2015-10-17 19:11:04 -04:00
parent 8f716363a7
commit 75e6216ca2
2 changed files with 5 additions and 6 deletions

View File

@ -243,7 +243,6 @@
<Compile Include="tools\RamSearchEngine.cs" />
<Compile Include="tools\Watch.cs" />
<Compile Include="tools\WatchList.cs" />
<Compile Include="UIHelper.cs" />
<Compile Include="XmlGame.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.Common
{
public class RomLoader
{
public enum LoadErrorType { Unknown, MissingFirmware, XML }
public enum LoadErrorType { Unknown, MissingFirmware, XML, DiscError }
// helper methods for the settings events
private object GetCoreSettings<T>()
@ -265,7 +265,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError);
return false;
}
@ -324,7 +324,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError);
return false;
}
@ -460,7 +460,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "PSX", LoadErrorType.DiscError);
return false;
}
@ -515,7 +515,7 @@ namespace BizHawk.Client.Common
{
// need to get rid of this hack at some point
rom = new RomGame(file);
((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", String.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename
((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", string.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename
byte[] romData = null;
byte[] xmlData = rom.FileData;