Fixed, "OpenMapInCurrentWad" action: we should not switch to already opened map.

Fixed, Open Map form: a warning is now displayed when no map is selected when accepting the form.
This commit is contained in:
MaxED 2014-11-03 13:58:19 +00:00
parent f986f5c98d
commit 720b4e01ec
2 changed files with 11 additions and 0 deletions

View file

@ -1194,6 +1194,11 @@ namespace CodeImp.DoomBuilder
// Open map options dialog
ChangeMapForm changemapwindow = new ChangeMapForm(map.FilePathName, map.Options);
if(changemapwindow.ShowDialog(mainwindow) != DialogResult.OK) return;
if (map.Options.CurrentName == changemapwindow.Options.CurrentName)
{
mainwindow.DisplayStatus(StatusType.Info, "Map '" + map.Options.CurrentName + "' is already loaded!");
return;
}
// Display status
mainwindow.DisplayStatus(StatusType.Busy, "Switching to map '" + changemapwindow.Options.CurrentName + "'...");

View file

@ -137,6 +137,12 @@ namespace CodeImp.DoomBuilder.Windows
}
private void apply_Click(object sender, EventArgs e) {
if (mapslist.SelectedItems.Count < 1)
{
General.ShowWarningMessage("Please select a map first!", MessageBoxButtons.OK);
return;
}
options.CurrentName = mapslist.SelectedItems[0].Text;
options.PreviousName = string.Empty;