- Editors now open and close correctly without having all of the editors visible at once.

- Realm Exporer, Zone Builder and Room Designer no longer attempt to shut down the toolkit when the Close button is clicked. Previous editor is restored.
This commit is contained in:
Scionwest_cp 2009-12-03 13:31:29 -08:00
parent f86975c8b9
commit 09fa576025
4 changed files with 57 additions and 8 deletions

View file

@ -180,7 +180,7 @@ namespace MudDesigner.Editors
private void btnClose_Click(object sender, EventArgs e)
{
Application.Exit();
this.Close();
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
@ -209,6 +209,13 @@ namespace MudDesigner.Editors
{
ZoneBuilder form = new ZoneBuilder();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
private void btnPlaceZone_Click(object sender, EventArgs e)

View file

@ -156,7 +156,7 @@ namespace MudDesigner.Editors
/// <param name="e"></param>
private void btnCloseEditor_Click(object sender, EventArgs e)
{
Application.Exit();
this.Close();
}
/// <summary>

View file

@ -30,6 +30,13 @@ namespace MudDesigner.Editors
ProjectSettings form = new ProjectSettings();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
private void btnCurrencyEditor_Click(object sender, EventArgs e)
@ -37,6 +44,13 @@ namespace MudDesigner.Editors
CurrencyEditor form = new CurrencyEditor();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
private void btnRoomDesigner_Click(object sender, EventArgs e)
@ -44,6 +58,13 @@ namespace MudDesigner.Editors
RoomDesigner form = new RoomDesigner();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
private void btnRealmExplorer_Click(object sender, EventArgs e)
@ -51,6 +72,13 @@ namespace MudDesigner.Editors
RealmExplorer form = new RealmExplorer();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
private void btnZoneBuilder_Click(object sender, EventArgs e)
@ -58,6 +86,13 @@ namespace MudDesigner.Editors
ZoneBuilder form = new ZoneBuilder();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
form = null;
this.Show();
}
}
}

View file

@ -42,8 +42,10 @@ namespace MudDesigner.Editors
private void btnRoomEditor_Click(object sender, EventArgs e)
{
DialogResult result;
string argument = "";
RoomDesigner form = new RoomDesigner();
Program.Room = new Room();
//Check if we have a room selected, if so we are going to ask if the user wants to edit it.
if (lstRooms.SelectedItem != null)
{
result = MessageBox.Show("You have a room selected, are you wanting to edit it?",
@ -52,23 +54,28 @@ namespace MudDesigner.Editors
switch (result)
{
case DialogResult.Yes:
argument += " \"room=" + lstRooms.SelectedItem.ToString() + ".room\"";
form = new RoomDesigner(lstRooms.SelectedItem.ToString());
string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Rooms), lstRooms.SelectedItem.ToString());
Program.Room = (Room)FileManager.Load(filename, Program.Room);
break;
case DialogResult.Cancel:
return;
}
}
RoomDesigner form = new RoomDesigner();
form.Show();
this.Hide();
while (form.Created)
Application.DoEvents();
MessageBox.Show("Broke.");
form = null;
this.Show();
}
private void btnClose_Click(object sender, EventArgs e)
{
Application.Exit();
this.Close();
}
private void btnSaveZone_Click(object sender, EventArgs e)