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
|
@ -36,6 +36,8 @@ 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)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Boolean isFoundScrapland = modsLauncher.SearchForScrapland();
|
Boolean isFoundScrapland = modsLauncher.SearchForScrapland();
|
||||||
if (!isFoundScrapland)
|
if (!isFoundScrapland)
|
||||||
|
@ -44,6 +46,11 @@ namespace ScrapModLoader
|
||||||
MessageBox.Show("Error: unable to find Scrapland instalation. Please, specify yours game installation folder in settings.");
|
MessageBox.Show("Error: unable to find Scrapland instalation. Please, specify yours game installation folder in settings.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (KeyNotFoundException ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
((ComboBoxItem)ScraplandVersion.Items[0]).IsEnabled = modsLauncher.ScraplandPath != String.Empty;
|
((ComboBoxItem)ScraplandVersion.Items[0]).IsEnabled = modsLauncher.ScraplandPath != String.Empty;
|
||||||
((ComboBoxItem)ScraplandVersion.Items[1]).IsEnabled = modsLauncher.ScraplandRemasteredPath != String.Empty;
|
((ComboBoxItem)ScraplandVersion.Items[1]).IsEnabled = modsLauncher.ScraplandRemasteredPath != String.Empty;
|
||||||
|
@ -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