Added a try/catch on NDS when selecting a rom path

This commit is contained in:
ZestyTS 2024-04-03 11:57:15 -07:00
parent 112fa7f0fd
commit 8e61d1846d

View file

@ -92,29 +92,47 @@ namespace UWUVCI_AIO_WPF.UI.Frames.InjectFrames.Configurations
private void Set_Rom_Path(object sender, RoutedEventArgs e)
{
string path = mvm.GetFilePath(true, false);
if (!CheckIfNull(path)) {
mvm.RomPath = path;
mvm.RomSet = true;
if (mvm.BaseDownloaded)
try
{
if (!CheckIfNull(path))
{
mvm.CanInject = true;
mvm.RomPath = path;
mvm.RomSet = true;
if (mvm.BaseDownloaded)
{
mvm.CanInject = true;
}
if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS)
{
mvm.getBootIMGNDS(mvm.RomPath);
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NES)
{
mvm.getBootIMGNES(mvm.RomPath);
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.SNES)
{
mvm.getBootIMGSNES(mvm.RomPath);
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.MSX)
{
mvm.getBootIMGMSX(mvm.RomPath);
}
}
if(mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NDS)
}
catch(Exception ex)
{
Custom_Message cm = new Custom_Message("Set_Rom_Path", ex.Message);
try
{
mvm.getBootIMGNDS(mvm.RomPath);
}else if(mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.NES)
{
mvm.getBootIMGNES(mvm.RomPath);
cm.Owner = mvm.mw;
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.SNES)
catch (Exception)
{
mvm.getBootIMGSNES(mvm.RomPath);
}
else if (mvm.GameConfiguration.Console == GameBaseClassLibrary.GameConsoles.MSX)
{
mvm.getBootIMGMSX(mvm.RomPath);
}
cm.ShowDialog();
}
}