mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-10 05:34:13 +00:00
Fixed crash:
If clicking Cancel on Import Config the program crashed
This commit is contained in:
parent
8b759ec064
commit
52b2c321e7
2 changed files with 10 additions and 12 deletions
|
@ -592,7 +592,7 @@ namespace UWUVCI_AIO_WPF
|
|||
}
|
||||
return false;
|
||||
}
|
||||
public string selectConfig()
|
||||
public void selectConfig(GameConsoles console)
|
||||
{
|
||||
string ret = string.Empty;
|
||||
using (var dialog = new System.Windows.Forms.OpenFileDialog())
|
||||
|
@ -602,9 +602,14 @@ namespace UWUVCI_AIO_WPF
|
|||
if (res == DialogResult.OK)
|
||||
{
|
||||
ret = dialog.FileName;
|
||||
if (GetConsoleOfConfig(ret, console))
|
||||
{
|
||||
ImportConfig(ret);
|
||||
MessageBox.Show("Please re-select a base!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
public string GetFilePath(bool ROM, bool INI)
|
||||
|
|
|
@ -21,10 +21,12 @@ namespace UWUVCI_AIO_WPF.UI.Frames
|
|||
public partial class INJECTFRAME : Page, IDisposable
|
||||
{
|
||||
MainViewModel mvm;
|
||||
GameConsoles console;
|
||||
public INJECTFRAME(GameConsoles console)
|
||||
{
|
||||
mvm = FindResource("mvm") as MainViewModel;
|
||||
InitializeComponent();
|
||||
this.console = console;
|
||||
if(console == GameConsoles.N64)
|
||||
{
|
||||
fLoadConfig.Content = new InjectFrames.Configurations.N64Config();
|
||||
|
@ -47,17 +49,8 @@ namespace UWUVCI_AIO_WPF.UI.Frames
|
|||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//import config
|
||||
string s = mvm.selectConfig();
|
||||
mvm.selectConfig(console);
|
||||
|
||||
if (s != null)
|
||||
{
|
||||
if (mvm.GetConsoleOfConfig(s, mvm.GameConfiguration.Console))
|
||||
{
|
||||
mvm.ImportConfig(s);
|
||||
MessageBox.Show("Please re-select a base!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue