bug fixes

This commit is contained in:
Bitl 2021-07-30 13:11:20 -07:00
parent f105533c64
commit b995afe019
1 changed files with 6 additions and 2 deletions

View File

@ -1182,6 +1182,7 @@ namespace NovetusLauncher
} }
string mapname = Path.GetFileName(ofd.FileName); string mapname = Path.GetFileName(ofd.FileName);
bool success = true;
try try
{ {
@ -1190,13 +1191,16 @@ namespace NovetusLauncher
catch (Exception ex) catch (Exception ex)
{ {
MessageBox.Show("Novetus has experienced an error when adding your map file: " + ex.Message + "\n\nYour file has not been added. Please try again.", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Novetus has experienced an error when adding your map file: " + ex.Message + "\n\nYour file has not been added. Please try again.", "Novetus - Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
success = false;
} }
finally finally
{ {
if (File.Exists(GlobalPaths.MapsDir + @"\\" + mapname)) if (success)
{ {
RefreshMaps();
Tree.SelectedNode = TreeNodeHelper.SearchTreeView(mapname, Tree.Nodes); Tree.SelectedNode = TreeNodeHelper.SearchTreeView(mapname, Tree.Nodes);
MessageBox.Show("The map '" + mapname + "' was successfully added to Novetus!" , "Novetus - Map Upload Confirmation"); Tree.Focus();
MessageBox.Show("The map '" + mapname + "' was successfully added to Novetus!" , "Novetus - Map Added", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
} }
} }