mirror of
https://github.com/Strongleong/ScrapModLoader.git
synced 2024-08-15 00:03:19 +00:00
Try-catched some exceptions
This commit is contained in:
parent
75333e8f68
commit
ca870eb66b
1 changed files with 17 additions and 5 deletions
|
@ -37,11 +37,18 @@ namespace ScrapModLoader
|
||||||
// TODO: Refactor it to separate window with pretty loading animation
|
// TODO: Refactor it to separate window with pretty loading animation
|
||||||
if (modsLauncher.ScraplandPath == String.Empty && modsLauncher.ScraplandRemasteredPath == String.Empty)
|
if (modsLauncher.ScraplandPath == String.Empty && modsLauncher.ScraplandRemasteredPath == String.Empty)
|
||||||
{
|
{
|
||||||
Boolean isFoundScrapland = modsLauncher.SearchForScrapland();
|
try
|
||||||
if (!isFoundScrapland)
|
|
||||||
{
|
{
|
||||||
ButtonRunScrapland.IsEnabled = false;
|
Boolean isFoundScrapland = modsLauncher.SearchForScrapland();
|
||||||
MessageBox.Show("Error: unable to find Scrapland instalation. Please, specify yours game installation folder in settings.");
|
if (!isFoundScrapland)
|
||||||
|
{
|
||||||
|
ButtonRunScrapland.IsEnabled = false;
|
||||||
|
MessageBox.Show("Error: unable to find Scrapland instalation. Please, specify yours game installation folder in settings.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (KeyNotFoundException ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,11 +155,16 @@ namespace ScrapModLoader
|
||||||
|
|
||||||
private void ButtonSettings_Click(Object sender, RoutedEventArgs e)
|
private void ButtonSettings_Click(Object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SettingsWindow settingsWindow = new SettingsWindow();
|
SettingsWindow settingsWindow = new SettingsWindow(modsLauncher);
|
||||||
|
|
||||||
settingsWindow.ShowDialog();
|
settingsWindow.ShowDialog();
|
||||||
if (settingsWindow.Save)
|
if (settingsWindow.Save)
|
||||||
modsLauncher.ScanMods();
|
modsLauncher.ScanMods();
|
||||||
|
|
||||||
ModsList.Items.Refresh();
|
ModsList.Items.Refresh();
|
||||||
|
((ComboBoxItem)ScraplandVersion.Items[0]).IsEnabled = modsLauncher.ScraplandPath != String.Empty;
|
||||||
|
((ComboBoxItem)ScraplandVersion.Items[1]).IsEnabled = modsLauncher.ScraplandRemasteredPath != String.Empty;
|
||||||
|
ScraplandVersion.SelectedIndex = modsLauncher.ScraplandRemasteredPath != String.Empty ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonRunScrapland_Click(Object sender, RoutedEventArgs e)
|
private void ButtonRunScrapland_Click(Object sender, RoutedEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue