From c7f5a9b2a7bac9ebce0ba6b5c6f9500926f7917d Mon Sep 17 00:00:00 2001 From: Scionwest_cp Date: Tue, 8 Dec 2009 10:34:20 -0800 Subject: [PATCH] --- ..svnbridge/.svnbridge | 3 + Mud Designer/Editors/CurrencyEditor.cs | 12 +- .../Editors/ExistingRealms.Designer.cs | 1 - Mud Designer/Editors/ExistingRealms.cs | 48 +- Mud Designer/Editors/ProjectSettings.cs | 73 +-- .../Editors/ProjectSettings.designer.cs | 122 +--- Mud Designer/Editors/RealmExplorer.cs | 287 ++++----- .../Editors/RealmExplorer.designer.cs | 418 ++++++------- Mud Designer/Editors/ToolkitLauncher.cs | 15 + .../Editors/ToolkitLauncher.designer.cs | 15 + Mud Designer/Editors/ZoneBuilder.cs | 161 +---- Mud Designer/Editors/ZoneBuilder.designer.cs | 567 +++--------------- Mud Designer/Editors/ZoneBuilder.resx | 3 + Mud Designer/Mud Designer.csproj | 20 +- .../MudEngine/FileSystem/FileManager.cs | 16 + .../MudEngine/FileSystem/SaveDataTypes.cs | 2 - .../MudEngine/GameObjects/BaseObject.cs | 26 +- .../MudEngine/GameObjects/Currency.cs | 2 +- .../MudEngine/GameObjects/Environment/Door.cs | 11 +- .../GameObjects/Environment/Realm.cs | 33 +- .../MudEngine/GameObjects/Environment/Room.cs | 32 +- .../MudEngine/GameObjects/Environment/Zone.cs | 2 +- Mud Designer/MudEngine/Interfaces/IQuest.cs | 2 +- Mud Designer/Program.cs | 10 +- 24 files changed, 566 insertions(+), 1315 deletions(-) create mode 100644 ..svnbridge/.svnbridge diff --git a/..svnbridge/.svnbridge b/..svnbridge/.svnbridge new file mode 100644 index 0000000..ab8f4c7 --- /dev/null +++ b/..svnbridge/.svnbridge @@ -0,0 +1,3 @@ +svn:ignoreMud Designer ToolKit.jpeg +MudDesigner.suo + \ No newline at end of file diff --git a/Mud Designer/Editors/CurrencyEditor.cs b/Mud Designer/Editors/CurrencyEditor.cs index 8dcbbec..33ad615 100644 --- a/Mud Designer/Editors/CurrencyEditor.cs +++ b/Mud Designer/Editors/CurrencyEditor.cs @@ -11,8 +11,8 @@ using System.Windows.Forms; using MudDesigner.MudEngine; using MudDesigner.MudEngine.Attributes; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; namespace MudDesigner.Editors { @@ -56,8 +56,9 @@ namespace MudDesigner.Editors //nothing selected. if (lstCurrencies.SelectedIndex == -1) return; - - _Currency = (Currency)FileManager.Load(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml", _Currency); + + string filePath = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Currency), lstCurrencies.SelectedItem.ToString() + ".xml"); + _Currency = (Currency)FileManager.Load(filePath, _Currency); propertyGrid1.SelectedObject = _Currency; } @@ -80,7 +81,8 @@ namespace MudDesigner.Editors return; //Delete the files and remove from the list. - System.IO.File.Delete(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml"); + string filePath = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Currency), lstCurrencies.SelectedItem.ToString() + ".xml"); + System.IO.File.Delete(filePath); lstCurrencies.Items.Remove(lstCurrencies.SelectedItem); //Re-instance the currency and set it within the propertygrid. diff --git a/Mud Designer/Editors/ExistingRealms.Designer.cs b/Mud Designer/Editors/ExistingRealms.Designer.cs index 40478f7..41a7922 100644 --- a/Mud Designer/Editors/ExistingRealms.Designer.cs +++ b/Mud Designer/Editors/ExistingRealms.Designer.cs @@ -41,7 +41,6 @@ this.btnTransfer.TabIndex = 1; this.btnTransfer.Text = "Transfer Zone to Selected Realm"; this.btnTransfer.UseVisualStyleBackColor = true; - this.btnTransfer.Click += new System.EventHandler(this.btnTransfer_Click); // // lstRealms // diff --git a/Mud Designer/Editors/ExistingRealms.cs b/Mud Designer/Editors/ExistingRealms.cs index 16c1f96..53e20cc 100644 --- a/Mud Designer/Editors/ExistingRealms.cs +++ b/Mud Designer/Editors/ExistingRealms.cs @@ -7,8 +7,8 @@ using System.Linq; using System.Text; using System.Windows.Forms; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; namespace MudDesigner.Editors { @@ -20,7 +20,7 @@ namespace MudDesigner.Editors { InitializeComponent(); _Zone = new Zone(); - string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Zones), Zone + ".zone"); + string filename = System.IO.Path.Combine(FileManager.GetDataPath(Program.Realm.Name, Zone), Zone + ".zone"); _Zone = (Zone)FileManager.Load(filename, _Zone); string[] realms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Realms), "*.realm"); @@ -31,47 +31,5 @@ namespace MudDesigner.Editors lstRealms.Items.Add(realm.Name); } } - - private void btnTransfer_Click(object sender, EventArgs e) - { - if (lstRealms.SelectedItem.ToString() == Program.Realm.Name) - { - MessageBox.Show("The zone already belongs to this realm! Transfer canceled.", "Realm Explorer"); - return; - } - - RealmExplorer form = (RealmExplorer)Program.CurrentEditor; - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string zoneFile = System.IO.Path.Combine(zonePath, form.lstZones.SelectedItem.ToString() + ".zone"); - Program.Zone = (Zone)FileManager.Load(zoneFile, Program.Zone); - - //Make our changes to the old realm and zone - foreach (Zone zone in Program.Realm.Zones) - { - if (zone.Name == Program.Zone.Name) - { - Program.Realm.Zones.Remove(zone); - break; - } - } - form.lstZones.Items.Remove(form.lstZones.SelectedItem); - Program.Zone.Realm = lstRealms.SelectedItem.ToString(); - - //Save old realm and the zone - FileManager.Save(zoneFile, Program.Zone); - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(realmPath, Program.Realm.Filename); - FileManager.Save(realmFile, Program.Realm); - - //edit the new realm - realmFile = System.IO.Path.Combine(realmPath, lstRealms.SelectedItem.ToString() + ".realm"); - Realm realm = new Realm(); - realm = (Realm)FileManager.Load(realmFile, realm); - - realm.Zones.Add(Program.Zone); - FileManager.Save(realmFile, realm); - Program.Zone = new Zone(); - this.Close(); - } } } diff --git a/Mud Designer/Editors/ProjectSettings.cs b/Mud Designer/Editors/ProjectSettings.cs index 38f17e4..22c07f8 100644 --- a/Mud Designer/Editors/ProjectSettings.cs +++ b/Mud Designer/Editors/ProjectSettings.cs @@ -11,71 +11,24 @@ using System.Windows.Forms; using MudDesigner.MudEngine; using MudDesigner.MudEngine.Attributes; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; namespace MudDesigner.Editors { public partial class ProjectSettings : Form { - List zones; - List rooms; - public ProjectSettings() { InitializeComponent(); - zones = new List(); - rooms = new List(); } private void frmMain_Load(object sender, EventArgs e) { //Aquire the Project settings and show them. - propertyGrid1.SelectedObject = Program.Project; + propertySettings.SelectedObject = Program.Project; txtStory.Text = Program.Project.Story; - - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - string[] realms = System.IO.Directory.GetFiles(realmPath, "*.realm"); - foreach (string file in realms) - { - Realm realm = new Realm(); - realm = (Realm)FileManager.Load(file, realm); - comRealms.Items.Add(realm.Name); - } - - if (comRealms.Items.Count != 0) - comRealms.SelectedIndex = 0; - } - - private void comRealms_SelectedIndexChanged(object sender, EventArgs e) - { - if (comRealms.SelectedIndex == -1) - return; - - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(realmPath, comRealms.SelectedItem.ToString() + ".realm"); - Realm realm = new Realm(); - realm = (Realm)FileManager.Load(realmFile, realm); - foreach (Zone zone in realm.Zones) - { - lstZones.Items.Add(zone.Name); - } - } - - private void lstZones_SelectedIndexChanged(object sender, EventArgs e) - { - if (lstZones.SelectedIndex == -1) - return; - - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string zoneFile = System.IO.Path.Combine(zonePath, lstZones.SelectedItem.ToString() + ".zone"); - Zone zone = new Zone(); - zone = (Zone)FileManager.Load(zoneFile, zone); - foreach (Room room in zone.Rooms) - { - lstRooms.Items.Add(room.Name); - } } private void txtStory_TextChanged(object sender, EventArgs e) @@ -88,25 +41,5 @@ namespace MudDesigner.Editors string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Root), "Project.xml"); FileManager.Save(filename, Program.Project); } - - private void lstRooms_SelectedIndexChanged(object sender, EventArgs e) - { - string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms); - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - - string roomFile = System.IO.Path.Combine(roomPath, lstRooms.SelectedItem.ToString() + ".room"); - string zoneFile = System.IO.Path.Combine(zonePath, lstZones.SelectedItem.ToString() + ".zone"); - string realmFile = System.IO.Path.Combine(realmPath, comRealms.SelectedItem.ToString() + ".realm"); - - Room room = new Room(); - Zone zone = new Zone(); - Realm realm = new Realm(); - room = (Room)FileManager.Load(roomFile, room); - zone = (Zone)FileManager.Load(zoneFile, zone); - realm = (Realm)FileManager.Load(realmFile, realm); - - //TODO: Fix broken InitialLocation - } } } diff --git a/Mud Designer/Editors/ProjectSettings.designer.cs b/Mud Designer/Editors/ProjectSettings.designer.cs index f4337c7..28f7370 100644 --- a/Mud Designer/Editors/ProjectSettings.designer.cs +++ b/Mud Designer/Editors/ProjectSettings.designer.cs @@ -29,24 +29,13 @@ private void InitializeComponent() { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); + this.propertySettings = new System.Windows.Forms.PropertyGrid(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.txtStory = new System.Windows.Forms.RichTextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.comRealms = new System.Windows.Forms.ComboBox(); - this.lstZones = new System.Windows.Forms.ListBox(); - this.lstRooms = new System.Windows.Forms.ListBox(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.groupBox5.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -57,30 +46,30 @@ // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.propertyGrid1); + this.splitContainer1.Panel1.Controls.Add(this.propertySettings); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.groupBox5); - this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Size = new System.Drawing.Size(573, 390); this.splitContainer1.SplitterDistance = 254; this.splitContainer1.TabIndex = 0; // - // propertyGrid1 + // propertySettings // - this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill; - this.propertyGrid1.Location = new System.Drawing.Point(0, 0); - this.propertyGrid1.Name = "propertyGrid1"; - this.propertyGrid1.Size = new System.Drawing.Size(254, 390); - this.propertyGrid1.TabIndex = 0; + this.propertySettings.Dock = System.Windows.Forms.DockStyle.Fill; + this.propertySettings.Location = new System.Drawing.Point(0, 0); + this.propertySettings.Name = "propertySettings"; + this.propertySettings.Size = new System.Drawing.Size(254, 390); + this.propertySettings.TabIndex = 0; + this.propertySettings.ToolbarVisible = false; // // groupBox5 // this.groupBox5.Controls.Add(this.txtStory); - this.groupBox5.Location = new System.Drawing.Point(3, 214); + this.groupBox5.Location = new System.Drawing.Point(3, 3); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(309, 173); + this.groupBox5.Size = new System.Drawing.Size(309, 384); this.groupBox5.TabIndex = 1; this.groupBox5.TabStop = false; this.groupBox5.Text = "Project Story"; @@ -90,85 +79,11 @@ this.txtStory.Dock = System.Windows.Forms.DockStyle.Fill; this.txtStory.Location = new System.Drawing.Point(3, 16); this.txtStory.Name = "txtStory"; - this.txtStory.Size = new System.Drawing.Size(303, 154); + this.txtStory.Size = new System.Drawing.Size(303, 365); this.txtStory.TabIndex = 2; this.txtStory.Text = ""; this.txtStory.TextChanged += new System.EventHandler(this.txtStory_TextChanged); // - // groupBox1 - // - this.groupBox1.Controls.Add(this.groupBox4); - this.groupBox1.Controls.Add(this.groupBox3); - this.groupBox1.Controls.Add(this.groupBox2); - this.groupBox1.Location = new System.Drawing.Point(3, 0); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(309, 208); - this.groupBox1.TabIndex = 2; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Initial Room Setup"; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.lstRooms); - this.groupBox4.Location = new System.Drawing.Point(158, 16); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(149, 186); - this.groupBox4.TabIndex = 2; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Available Rooms"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.lstZones); - this.groupBox3.Location = new System.Drawing.Point(6, 64); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(149, 138); - this.groupBox3.TabIndex = 1; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Available Zones"; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.comRealms); - this.groupBox2.Location = new System.Drawing.Point(3, 16); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(152, 42); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Available Realms"; - // - // comRealms - // - this.comRealms.Dock = System.Windows.Forms.DockStyle.Fill; - this.comRealms.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comRealms.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.comRealms.FormattingEnabled = true; - this.comRealms.Location = new System.Drawing.Point(3, 16); - this.comRealms.Name = "comRealms"; - this.comRealms.Size = new System.Drawing.Size(146, 21); - this.comRealms.TabIndex = 0; - this.comRealms.SelectedIndexChanged += new System.EventHandler(this.comRealms_SelectedIndexChanged); - // - // lstZones - // - this.lstZones.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstZones.FormattingEnabled = true; - this.lstZones.Location = new System.Drawing.Point(3, 16); - this.lstZones.Name = "lstZones"; - this.lstZones.Size = new System.Drawing.Size(143, 108); - this.lstZones.TabIndex = 0; - this.lstZones.SelectedIndexChanged += new System.EventHandler(this.lstZones_SelectedIndexChanged); - // - // lstRooms - // - this.lstRooms.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstRooms.FormattingEnabled = true; - this.lstRooms.Location = new System.Drawing.Point(3, 16); - this.lstRooms.Name = "lstRooms"; - this.lstRooms.Size = new System.Drawing.Size(143, 160); - this.lstRooms.TabIndex = 1; - this.lstRooms.SelectedIndexChanged += new System.EventHandler(this.lstRooms_SelectedIndexChanged); - // // ProjectSettings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -187,10 +102,6 @@ this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); this.groupBox5.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); this.ResumeLayout(false); } @@ -198,16 +109,9 @@ #endregion private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.PropertyGrid propertyGrid1; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.ComboBox comRealms; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.PropertyGrid propertySettings; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.RichTextBox txtStory; - private System.Windows.Forms.ListBox lstZones; - private System.Windows.Forms.ListBox lstRooms; } } diff --git a/Mud Designer/Editors/RealmExplorer.cs b/Mud Designer/Editors/RealmExplorer.cs index dfc44af..055644c 100644 --- a/Mud Designer/Editors/RealmExplorer.cs +++ b/Mud Designer/Editors/RealmExplorer.cs @@ -6,238 +6,197 @@ using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; +using System.IO; using ManagedScripting; //MudEngine using MudDesigner.MudEngine; using MudDesigner.MudEngine.Attributes; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; namespace MudDesigner.Editors { public partial class RealmExplorer : Form { - List _AvailableZones; - + List realms; + List zones; + List rooms; + public RealmExplorer() { + //build our UI InitializeComponent(); + + //instance our collections + realms = new List(); + zones = new List(); + rooms = new List(); + + //instance the environments Program.Zone = new Zone(); Program.Realm = new Realm(); Program.Room = new Room(); - _AvailableZones = new List(); + //instance the script engine Program.ScriptEngine = new ScriptingEngine(); Program.ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory; Program.ScriptEngine.KeepTempFiles = false; - propertyRealm.SelectedObject = Program.Realm; + //Build an array of realm directories + string[] directories = System.IO.Directory.GetDirectories(FileManager.GetDataPath(SaveDataTypes.Realms)); + //loop through each realm folder and get it's realm file + foreach (string dir in directories) + { + //instance a new realm + Realm r = new Realm(); + + //Split the path to the realm folder into an array + //so we can get the final folder name (our realm directory) + string[] folders = dir.Split('\\'); - string[] existingRealms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Realms)); - foreach (string realm in existingRealms) - lstRealms.Items.Add(System.IO.Path.GetFileNameWithoutExtension(realm)); + //Build our realm file paths. + if (!folders.Length.Equals(0)) + { + string realmFile = folders[folders.Length - 1] + ".realm"; + string realmPath = System.IO.Path.Combine(dir, realmFile); + + //if the realm path exists, load the realm and add it to the listbox + if (System.IO.File.Exists(realmPath)) + { + r = (Realm)FileManager.Load(realmPath, r); + realms.Add(r); + lstRealms.Items.Add(r.Name); + } + else + { + MessageBox.Show("Failed to load Realm '" + System.IO.Path.GetFileNameWithoutExtension(realmFile) + + "'.\nThis error is generated due to the Realm folder existing, but the Realm file missing.", "Realm Explorer", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + } + } + } + + bool RealmExists(string realm) + { + string realmPath = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), realm); + if (Directory.Exists(realm)) + return true; + else + return false; } private void btnNewRealm_Click(object sender, EventArgs e) { - Program.Zone = new Zone(); + //Reinstance all of our environments Program.Realm = new Realm(); - lstZones.Items.Clear(); - + Program.Zone = new Zone(); + Program.Room = new Room(); + propertyRealm.SelectedObject = Program.Realm; + txtScript.Text = Program.Realm.Script; } private void btnSaveRealm_Click(object sender, EventArgs e) { - string path = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(path, Program.Realm.Filename); + //get our paths first. + string realmPath = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), Program.Realm.Name); + string realmFile = System.IO.Path.Combine(realmPath, Program.Realm.Filename); + //check if the directory exists + if (!RealmExists(Program.Realm.Name)) + System.IO.Directory.CreateDirectory(realmPath); + + //save the realm FileManager.Save(realmFile, Program.Realm); + //add it to the list box if it isn't already there if (!lstRealms.Items.Contains(Program.Realm.Name)) - lstRealms.Items.Add(Program.Realm.Name); - } + lstRealms.Items.Add(Program.Realm.Name); - private void lstRealms_SelectedIndexChanged(object sender, EventArgs e) - { - if (lstRealms.SelectedIndex == -1) - return; - lstZones.Items.Clear(); + //sets to true if the realm already exists (incase we are editing) + bool realmFound = false; + foreach (Realm r in realms) + { + //if the current realm in the loop matches our currently loaded realm + if (r.Name == Program.Realm.Name) + { + //we found it. + realmFound = true; + break; + } + } - string path = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(path, lstRealms.SelectedItem.ToString() + ".realm"); - Program.Realm = (Realm)FileManager.Load(realmFile, Program.Realm); + //if the currently loaded room is already in our collection + //don't add it again. + if (!realmFound) + realms.Add(Program.Realm); - propertyRealm.SelectedObject = Program.Realm; - foreach (Zone zone in Program.Realm.Zones) - lstZones.Items.Add(zone.Name); + //Select our new realm in the listbox + lstRealms.SelectedIndex = lstRealms.Items.IndexOf(Program.Realm.Name); } private void btnDeleteRealm_Click(object sender, EventArgs e) { + //Make sure we have our realm selected if (lstRealms.SelectedIndex == -1) { MessageBox.Show("Select a Realm to delete first!", "Realm Exporer", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } + //Ask to make sure its ok to delete the realm and all of its + //zones/rooms that are contained within it. DialogResult result = MessageBox.Show("Are you sure you want to delete the " + lstRealms.SelectedItem.ToString() + " Realm?\n\nWarning! All Zones & Rooms contained within this Realm will be deleted!", "Realm Explorer", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + //cancel the delete if (result == DialogResult.No) return; - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(realmPath, lstRealms.SelectedItem.ToString() + ".realm"); - - foreach (Zone zone in Program.Realm.Zones) - { - foreach (Room room in zone.Rooms) - { - string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms); - string roomFile = System.IO.Path.Combine(roomPath, room.Filename); - System.IO.File.Delete(roomFile); - } - - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string zoneFile = System.IO.Path.Combine(zonePath, zone.Filename); - System.IO.File.Delete(zoneFile); - } - //loop through each zone first and delete them all, along with their there rooms. - System.IO.File.Delete(realmFile); - lstRealms.Items.Remove(lstRealms.SelectedItem); - lstZones.Items.Clear(); - btnNewRealm_Click(sender, e); - } - - private void btnClose_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) - { - if (tabControl1.SelectedTab.Text == "Script") - { - txtScript.Text = Program.Realm.Script; - } - } - - private void btnValidateScript_Click(object sender, EventArgs e) - { - Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler; - Program.ScriptEngine.AddReference(FileManager.GetDataPath(SaveDataTypes.Root) + "\\Mud Designer.exe"); - string code = "namespace MudDesigner.MudEngine.Objects.Environment\n" - + "{\n" - + " public class " + Program.Realm.Name.Replace(" ", "") + " : Realm\n" - + " {\n" - + " " + txtScript.Text + "\n" - + " }\n" - + "}\n"; - MessageBox.Show(Program.ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - - private void btnBuildZone_Click(object sender, EventArgs e) - { - if (lstRealms.SelectedIndex == -1) - { - MessageBox.Show("Select a Realm to build a Zone for.", "Realm Explorer", MessageBoxButtons.OK); - return; - } + //get our paths + string realmPath = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), Program.Realm.Name); - ZoneBuilder form = new ZoneBuilder(); + //Delete the realm and all of its contents (zones/rooms) + Directory.Delete(realmPath, true); - if (btnBuildZone.Text == "Edit Selected Zone") - form.IsEditingExisting = true; - - form.Show(); - this.Hide(); - - while (form.Created) - Application.DoEvents(); - - form = null; - - this.Show(); + //remove it from the listbox + lstRealms.Items.Remove(lstRealms.SelectedItem); + //clear the room + Program.Realm = new Realm(); + propertyRealm.SelectedObject = null; } - - private void btnMoveZone_Click(object sender, EventArgs e) + private void btnLoadRealm_Click(object sender, EventArgs e) { - if (lstZones.SelectedIndex == -1) - { - MessageBox.Show("Select a Zone to transfer first.", "Realm Explorer", MessageBoxButtons.OK); - return; - } - - ExistingRealms form = new ExistingRealms(lstZones.SelectedItem.ToString()); - form.Show(); - this.Hide(); - - while (form.Created) - Application.DoEvents(); - - this.Show(); - } - - private void btnUnselectZone_Click(object sender, EventArgs e) - { - lstZones.SelectedIndex = -1; - btnBuildZone.Text = "Build A Zone"; - } - - private void btnDeleteZone_Click(object sender, EventArgs e) - { - if (lstZones.SelectedIndex == -1) - { - MessageBox.Show("No zone selected for deletion.", "Realm Explorer", MessageBoxButtons.OK); - return; - } - - Zone zone = Program.Realm.GetZone(lstZones.SelectedItem.ToString()); - if (zone == null) - { - MessageBox.Show("Error deleting Zone.", "Realm Exporer"); - return; - } - - DialogResult result = MessageBox.Show("Are you sure you wish to delete the Zone '" + lstZones.SelectedItem.ToString() + "'?\nWarning! All Rooms contained within this Zone will be deleted!", "Realm Explorer", MessageBoxButtons.YesNo); - - if (result == DialogResult.No) + //Incase an item was selected & removed from the listbox + //this event gets triggered, even though nothing is selected. + if (lstRealms.SelectedIndex == -1) return; - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string zoneFile = System.IO.Path.Combine(zonePath, lstZones.SelectedItem.ToString() + ".zone"); - Program.Zone = (Zone)FileManager.Load(zoneFile, Program.Zone); - foreach (Room room in Program.Zone.Rooms) + //Loop through the realms collection to find the selected realm + foreach (Realm r in realms) { - string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms); - string roomFile = System.IO.Path.Combine(roomPath, room.Filename); - System.IO.File.Delete(roomFile); - } - - foreach (Zone z in Program.Realm.Zones) - { - if (z.Name == lstZones.SelectedItem.ToString()) + //check if we have a match + if (r.Name == lstRealms.SelectedItem.ToString()) { - Program.Realm.Zones.Remove(z); + //load it. + Program.Realm = r; + txtScript.Text = Program.Realm.Script; + propertyRealm.SelectedObject = r; break; } } - string filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Zones), lstZones.SelectedItem.ToString() + ".zone"); - if (System.IO.File.Exists(filename)) - System.IO.File.Delete(filename); - - filename = System.IO.Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), Program.Realm.Filename); - lstZones.Items.Remove(lstZones.SelectedItem); - FileManager.Save(filename, Program.Realm); - } - - private void lstZones_SelectedIndexChanged(object sender, EventArgs e) - { - btnBuildZone.Text = "Edit Selected Zone"; + //now that the realm is loaded, we need to loop through each + //zone within the realm, and load it's rooms, scanning for available + //exists for the realm to use. + foreach (string zone in Program.Realm.Zones) + { + Zone z = new Zone(); + z = Program.Realm.GetZone(zone); + } } private void txtScript_TextChanged(object sender, EventArgs e) diff --git a/Mud Designer/Editors/RealmExplorer.designer.cs b/Mud Designer/Editors/RealmExplorer.designer.cs index cc3de5c..66b1c23 100644 --- a/Mud Designer/Editors/RealmExplorer.designer.cs +++ b/Mud Designer/Editors/RealmExplorer.designer.cs @@ -28,246 +28,162 @@ /// private void InitializeComponent() { - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.lstRealms = new System.Windows.Forms.ListBox(); - this.propertyRealm = new System.Windows.Forms.PropertyGrid(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabOptions = new System.Windows.Forms.TabPage(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.tabRealm = new System.Windows.Forms.TabPage(); + this.tabScript = new System.Windows.Forms.TabPage(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.btnDeleteZone = new System.Windows.Forms.Button(); - this.btnUnselectZone = new System.Windows.Forms.Button(); - this.btnMoveZone = new System.Windows.Forms.Button(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.lstZones = new System.Windows.Forms.ListBox(); - this.btnBuildZone = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnClose = new System.Windows.Forms.Button(); + this.btnLoadRealm = new System.Windows.Forms.Button(); this.btnSaveRealm = new System.Windows.Forms.Button(); this.btnDeleteRealm = new System.Windows.Forms.Button(); this.btnNewRealm = new System.Windows.Forms.Button(); - this.tabScript = new System.Windows.Forms.TabPage(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.lstRealms = new System.Windows.Forms.ListBox(); + this.propertyRealm = new System.Windows.Forms.PropertyGrid(); this.txtScript = new System.Windows.Forms.RichTextBox(); - this.btnValidateScript = new System.Windows.Forms.Button(); + this.tabControl1.SuspendLayout(); + this.tabRealm.SuspendLayout(); + this.tabScript.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabOptions.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.groupBox4.SuspendLayout(); this.groupBox2.SuspendLayout(); - this.tabScript.SuspendLayout(); + this.groupBox1.SuspendLayout(); this.SuspendLayout(); // + // button1 + // + this.button1.Location = new System.Drawing.Point(126, 18); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(109, 23); + this.button1.TabIndex = 11; + this.button1.Text = "Load Realm"; + this.button1.UseVisualStyleBackColor = true; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(127, 47); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(109, 23); + this.button2.TabIndex = 10; + this.button2.Text = "Save Realm"; + this.button2.UseVisualStyleBackColor = true; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(6, 48); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(114, 23); + this.button3.TabIndex = 9; + this.button3.Text = "Delete Realm"; + this.button3.UseVisualStyleBackColor = true; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(6, 19); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(114, 23); + this.button4.TabIndex = 8; + this.button4.Text = "New Realm"; + this.button4.UseVisualStyleBackColor = true; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabRealm); + this.tabControl1.Controls.Add(this.tabScript); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(0, 0); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(470, 464); + this.tabControl1.TabIndex = 0; + // + // tabRealm + // + this.tabRealm.Controls.Add(this.splitContainer1); + this.tabRealm.Location = new System.Drawing.Point(4, 22); + this.tabRealm.Name = "tabRealm"; + this.tabRealm.Padding = new System.Windows.Forms.Padding(3); + this.tabRealm.Size = new System.Drawing.Size(462, 438); + this.tabRealm.TabIndex = 0; + this.tabRealm.Text = "Realm Setup"; + this.tabRealm.UseVisualStyleBackColor = true; + // + // tabScript + // + this.tabScript.Controls.Add(this.txtScript); + this.tabScript.Location = new System.Drawing.Point(4, 22); + this.tabScript.Name = "tabScript"; + this.tabScript.Padding = new System.Windows.Forms.Padding(3); + this.tabScript.Size = new System.Drawing.Size(462, 438); + this.tabScript.TabIndex = 1; + this.tabScript.Text = "Realm Script"; + this.tabScript.UseVisualStyleBackColor = true; + // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Location = new System.Drawing.Point(3, 3); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.splitContainer2); + this.splitContainer1.Panel1.Controls.Add(this.groupBox1); + this.splitContainer1.Panel1.Controls.Add(this.groupBox2); // // splitContainer1.Panel2 // - this.splitContainer1.Panel2.Controls.Add(this.groupBox1); - this.splitContainer1.Size = new System.Drawing.Size(536, 488); - this.splitContainer1.SplitterDistance = 208; + this.splitContainer1.Panel2.Controls.Add(this.groupBox3); + this.splitContainer1.Size = new System.Drawing.Size(456, 432); + this.splitContainer1.SplitterDistance = 196; this.splitContainer1.TabIndex = 0; // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.lstRealms); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.propertyRealm); - this.splitContainer2.Size = new System.Drawing.Size(208, 488); - this.splitContainer2.SplitterDistance = 220; - this.splitContainer2.TabIndex = 0; - // - // lstRealms - // - this.lstRealms.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstRealms.FormattingEnabled = true; - this.lstRealms.Location = new System.Drawing.Point(0, 0); - this.lstRealms.Name = "lstRealms"; - this.lstRealms.Size = new System.Drawing.Size(208, 212); - this.lstRealms.Sorted = true; - this.lstRealms.TabIndex = 0; - this.lstRealms.SelectedIndexChanged += new System.EventHandler(this.lstRealms_SelectedIndexChanged); - // - // propertyRealm - // - this.propertyRealm.Dock = System.Windows.Forms.DockStyle.Fill; - this.propertyRealm.Location = new System.Drawing.Point(0, 0); - this.propertyRealm.Name = "propertyRealm"; - this.propertyRealm.Size = new System.Drawing.Size(208, 264); - this.propertyRealm.TabIndex = 0; - this.propertyRealm.ToolbarVisible = false; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.tabControl1); - this.groupBox1.Location = new System.Drawing.Point(0, 0); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(332, 459); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Realm Setup"; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabOptions); - this.tabControl1.Controls.Add(this.tabScript); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(3, 16); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(326, 440); - this.tabControl1.TabIndex = 0; - this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); - // - // tabOptions - // - this.tabOptions.Controls.Add(this.groupBox5); - this.tabOptions.Controls.Add(this.groupBox3); - this.tabOptions.Controls.Add(this.groupBox2); - this.tabOptions.Location = new System.Drawing.Point(4, 22); - this.tabOptions.Name = "tabOptions"; - this.tabOptions.Padding = new System.Windows.Forms.Padding(3); - this.tabOptions.Size = new System.Drawing.Size(318, 414); - this.tabOptions.TabIndex = 0; - this.tabOptions.Text = "Realm Options"; - this.tabOptions.UseVisualStyleBackColor = true; - // - // groupBox5 - // - this.groupBox5.Location = new System.Drawing.Point(3, 297); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(312, 114); - this.groupBox5.TabIndex = 14; - this.groupBox5.TabStop = false; - // // groupBox3 // - this.groupBox3.Controls.Add(this.btnDeleteZone); - this.groupBox3.Controls.Add(this.btnUnselectZone); - this.groupBox3.Controls.Add(this.btnMoveZone); - this.groupBox3.Controls.Add(this.groupBox4); - this.groupBox3.Controls.Add(this.btnBuildZone); - this.groupBox3.Location = new System.Drawing.Point(3, 88); + this.groupBox3.Controls.Add(this.propertyRealm); + this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox3.Location = new System.Drawing.Point(0, 0); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(312, 206); - this.groupBox3.TabIndex = 13; + this.groupBox3.Size = new System.Drawing.Size(256, 432); + this.groupBox3.TabIndex = 34; this.groupBox3.TabStop = false; - this.groupBox3.Text = "Zone Setup"; - // - // btnDeleteZone - // - this.btnDeleteZone.Location = new System.Drawing.Point(104, 175); - this.btnDeleteZone.Name = "btnDeleteZone"; - this.btnDeleteZone.Size = new System.Drawing.Size(101, 23); - this.btnDeleteZone.TabIndex = 16; - this.btnDeleteZone.Text = "Delete Zone"; - this.btnDeleteZone.UseVisualStyleBackColor = true; - this.btnDeleteZone.Click += new System.EventHandler(this.btnDeleteZone_Click); - // - // btnUnselectZone - // - this.btnUnselectZone.Location = new System.Drawing.Point(214, 175); - this.btnUnselectZone.Name = "btnUnselectZone"; - this.btnUnselectZone.Size = new System.Drawing.Size(95, 23); - this.btnUnselectZone.TabIndex = 15; - this.btnUnselectZone.Text = "Unselect Zone"; - this.btnUnselectZone.UseVisualStyleBackColor = true; - this.btnUnselectZone.Click += new System.EventHandler(this.btnUnselectZone_Click); - // - // btnMoveZone - // - this.btnMoveZone.Location = new System.Drawing.Point(3, 175); - this.btnMoveZone.Name = "btnMoveZone"; - this.btnMoveZone.Size = new System.Drawing.Size(95, 23); - this.btnMoveZone.TabIndex = 14; - this.btnMoveZone.Text = "Move Zone"; - this.btnMoveZone.UseVisualStyleBackColor = true; - this.btnMoveZone.Click += new System.EventHandler(this.btnMoveZone_Click); - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.lstZones); - this.groupBox4.Location = new System.Drawing.Point(3, 45); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(306, 132); - this.groupBox4.TabIndex = 13; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Zones within Realm"; - // - // lstZones - // - this.lstZones.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstZones.FormattingEnabled = true; - this.lstZones.Location = new System.Drawing.Point(3, 16); - this.lstZones.Name = "lstZones"; - this.lstZones.Size = new System.Drawing.Size(300, 108); - this.lstZones.TabIndex = 0; - this.lstZones.SelectedIndexChanged += new System.EventHandler(this.lstZones_SelectedIndexChanged); - // - // btnBuildZone - // - this.btnBuildZone.Dock = System.Windows.Forms.DockStyle.Top; - this.btnBuildZone.Location = new System.Drawing.Point(3, 16); - this.btnBuildZone.Name = "btnBuildZone"; - this.btnBuildZone.Size = new System.Drawing.Size(306, 23); - this.btnBuildZone.TabIndex = 12; - this.btnBuildZone.Text = "Build A Zone"; - this.btnBuildZone.UseVisualStyleBackColor = true; - this.btnBuildZone.Click += new System.EventHandler(this.btnBuildZone_Click); + this.groupBox3.Text = "Realm Properties"; // // groupBox2 // - this.groupBox2.Controls.Add(this.btnClose); + this.groupBox2.Controls.Add(this.btnLoadRealm); this.groupBox2.Controls.Add(this.btnSaveRealm); this.groupBox2.Controls.Add(this.btnDeleteRealm); this.groupBox2.Controls.Add(this.btnNewRealm); - this.groupBox2.Location = new System.Drawing.Point(3, 6); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top; + this.groupBox2.Location = new System.Drawing.Point(0, 0); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(312, 76); - this.groupBox2.TabIndex = 12; + this.groupBox2.Size = new System.Drawing.Size(196, 76); + this.groupBox2.TabIndex = 34; this.groupBox2.TabStop = false; - this.groupBox2.Text = "Editor Options"; + this.groupBox2.Text = "Realm Setup"; // - // btnClose + // btnLoadRealm // - this.btnClose.Location = new System.Drawing.Point(200, 47); - this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(109, 23); - this.btnClose.TabIndex = 11; - this.btnClose.Text = "Close Explorer"; - this.btnClose.UseVisualStyleBackColor = true; - this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + this.btnLoadRealm.Location = new System.Drawing.Point(106, 19); + this.btnLoadRealm.Name = "btnLoadRealm"; + this.btnLoadRealm.Size = new System.Drawing.Size(85, 23); + this.btnLoadRealm.TabIndex = 11; + this.btnLoadRealm.Text = "Load Realm"; + this.btnLoadRealm.UseVisualStyleBackColor = true; + this.btnLoadRealm.Click += new System.EventHandler(this.btnLoadRealm_Click); // // btnSaveRealm // - this.btnSaveRealm.Location = new System.Drawing.Point(200, 19); + this.btnSaveRealm.Location = new System.Drawing.Point(107, 48); this.btnSaveRealm.Name = "btnSaveRealm"; - this.btnSaveRealm.Size = new System.Drawing.Size(109, 23); + this.btnSaveRealm.Size = new System.Drawing.Size(84, 23); this.btnSaveRealm.TabIndex = 10; this.btnSaveRealm.Text = "Save Realm"; this.btnSaveRealm.UseVisualStyleBackColor = true; @@ -277,7 +193,7 @@ // this.btnDeleteRealm.Location = new System.Drawing.Point(6, 48); this.btnDeleteRealm.Name = "btnDeleteRealm"; - this.btnDeleteRealm.Size = new System.Drawing.Size(114, 23); + this.btnDeleteRealm.Size = new System.Drawing.Size(85, 23); this.btnDeleteRealm.TabIndex = 9; this.btnDeleteRealm.Text = "Delete Realm"; this.btnDeleteRealm.UseVisualStyleBackColor = true; @@ -287,96 +203,98 @@ // this.btnNewRealm.Location = new System.Drawing.Point(6, 19); this.btnNewRealm.Name = "btnNewRealm"; - this.btnNewRealm.Size = new System.Drawing.Size(114, 23); + this.btnNewRealm.Size = new System.Drawing.Size(85, 23); this.btnNewRealm.TabIndex = 8; this.btnNewRealm.Text = "New Realm"; this.btnNewRealm.UseVisualStyleBackColor = true; this.btnNewRealm.Click += new System.EventHandler(this.btnNewRealm_Click); // - // tabScript + // groupBox1 // - this.tabScript.Controls.Add(this.txtScript); - this.tabScript.Controls.Add(this.btnValidateScript); - this.tabScript.Location = new System.Drawing.Point(4, 22); - this.tabScript.Name = "tabScript"; - this.tabScript.Padding = new System.Windows.Forms.Padding(3); - this.tabScript.Size = new System.Drawing.Size(318, 414); - this.tabScript.TabIndex = 1; - this.tabScript.Text = "Script"; - this.tabScript.UseVisualStyleBackColor = true; + this.groupBox1.Controls.Add(this.lstRealms); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 76); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(196, 356); + this.groupBox1.TabIndex = 36; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Realms List"; + // + // lstRealms + // + this.lstRealms.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstRealms.FormattingEnabled = true; + this.lstRealms.Location = new System.Drawing.Point(3, 16); + this.lstRealms.Name = "lstRealms"; + this.lstRealms.Size = new System.Drawing.Size(190, 329); + this.lstRealms.Sorted = true; + this.lstRealms.TabIndex = 17; + // + // propertyRealm + // + this.propertyRealm.Dock = System.Windows.Forms.DockStyle.Fill; + this.propertyRealm.Location = new System.Drawing.Point(3, 16); + this.propertyRealm.Name = "propertyRealm"; + this.propertyRealm.Size = new System.Drawing.Size(250, 413); + this.propertyRealm.TabIndex = 18; + this.propertyRealm.ToolbarVisible = false; // // txtScript // this.txtScript.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtScript.Location = new System.Drawing.Point(3, 26); + this.txtScript.Location = new System.Drawing.Point(3, 3); this.txtScript.Name = "txtScript"; - this.txtScript.Size = new System.Drawing.Size(312, 385); - this.txtScript.TabIndex = 11; + this.txtScript.Size = new System.Drawing.Size(456, 432); + this.txtScript.TabIndex = 0; this.txtScript.Text = ""; this.txtScript.TextChanged += new System.EventHandler(this.txtScript_TextChanged); // - // btnValidateScript - // - this.btnValidateScript.Dock = System.Windows.Forms.DockStyle.Top; - this.btnValidateScript.Location = new System.Drawing.Point(3, 3); - this.btnValidateScript.Name = "btnValidateScript"; - this.btnValidateScript.Size = new System.Drawing.Size(312, 23); - this.btnValidateScript.TabIndex = 10; - this.btnValidateScript.Text = "Validate Script"; - this.btnValidateScript.UseVisualStyleBackColor = true; - this.btnValidateScript.Click += new System.EventHandler(this.btnValidateScript_Click); - // // RealmExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(536, 488); - this.Controls.Add(this.splitContainer1); + this.ClientSize = new System.Drawing.Size(470, 464); + this.Controls.Add(this.tabControl1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "RealmExplorer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Realm Explorer"; + this.tabControl1.ResumeLayout(false); + this.tabRealm.ResumeLayout(false); + this.tabScript.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); - this.tabOptions.ResumeLayout(false); this.groupBox3.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); this.groupBox2.ResumeLayout(false); - this.tabScript.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.ListBox lstRealms; - private System.Windows.Forms.PropertyGrid propertyRealm; - private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabOptions; - private System.Windows.Forms.TabPage tabScript; - private System.Windows.Forms.Button btnValidateScript; - private System.Windows.Forms.RichTextBox txtScript; + private System.Windows.Forms.TabPage tabRealm; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ListBox lstRealms; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.Button btnBuildZone; - private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnLoadRealm; private System.Windows.Forms.Button btnSaveRealm; private System.Windows.Forms.Button btnDeleteRealm; private System.Windows.Forms.Button btnNewRealm; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.Button btnMoveZone; - private System.Windows.Forms.GroupBox groupBox5; - internal System.Windows.Forms.ListBox lstZones; - private System.Windows.Forms.Button btnUnselectZone; - private System.Windows.Forms.Button btnDeleteZone; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.PropertyGrid propertyRealm; + private System.Windows.Forms.TabPage tabScript; + private System.Windows.Forms.RichTextBox txtScript; + } diff --git a/Mud Designer/Editors/ToolkitLauncher.cs b/Mud Designer/Editors/ToolkitLauncher.cs index 40630ee..5a14830 100644 --- a/Mud Designer/Editors/ToolkitLauncher.cs +++ b/Mud Designer/Editors/ToolkitLauncher.cs @@ -66,5 +66,20 @@ namespace MudDesigner.Editors this.Show(); } + + private void btnZoneBuilder_Click(object sender, EventArgs e) + { + ZoneBuilder form = new ZoneBuilder(); + Program.CurrentEditor = form; + + form.Show(); + this.Hide(); + while (form.Created) + Application.DoEvents(); + + form = null; + + this.Show(); + } } } diff --git a/Mud Designer/Editors/ToolkitLauncher.designer.cs b/Mud Designer/Editors/ToolkitLauncher.designer.cs index 12df650..abb2180 100644 --- a/Mud Designer/Editors/ToolkitLauncher.designer.cs +++ b/Mud Designer/Editors/ToolkitLauncher.designer.cs @@ -48,6 +48,7 @@ this.groupBox8 = new System.Windows.Forms.GroupBox(); this.txtScript = new System.Windows.Forms.RichTextBox(); this.tabVariables = new System.Windows.Forms.TabPage(); + this.btnZoneBuilder = new System.Windows.Forms.Button(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); @@ -125,6 +126,7 @@ this.flowLayoutPanel1.Controls.Add(this.btnProjectSettings); this.flowLayoutPanel1.Controls.Add(this.btnCurrencyEditor); this.flowLayoutPanel1.Controls.Add(this.btnRealmExplorer); + this.flowLayoutPanel1.Controls.Add(this.btnZoneBuilder); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; @@ -300,6 +302,18 @@ this.tabVariables.Text = "Variables"; this.tabVariables.UseVisualStyleBackColor = true; // + // btnZoneBuilder + // + this.btnZoneBuilder.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.btnZoneBuilder.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnZoneBuilder.Location = new System.Drawing.Point(462, 3); + this.btnZoneBuilder.Name = "btnZoneBuilder"; + this.btnZoneBuilder.Size = new System.Drawing.Size(147, 55); + this.btnZoneBuilder.TabIndex = 4; + this.btnZoneBuilder.Text = "Zone Builder"; + this.btnZoneBuilder.UseVisualStyleBackColor = true; + this.btnZoneBuilder.Click += new System.EventHandler(this.btnZoneBuilder_Click); + // // ToolkitLauncher // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -351,6 +365,7 @@ private System.Windows.Forms.RichTextBox txtScript; private System.Windows.Forms.TabPage tabVariables; private System.Windows.Forms.Button btnRealmExplorer; + private System.Windows.Forms.Button btnZoneBuilder; } } diff --git a/Mud Designer/Editors/ZoneBuilder.cs b/Mud Designer/Editors/ZoneBuilder.cs index f19d0a7..fbba403 100644 --- a/Mud Designer/Editors/ZoneBuilder.cs +++ b/Mud Designer/Editors/ZoneBuilder.cs @@ -10,8 +10,8 @@ using System.Windows.Forms; using MudDesigner.MudEngine; using MudDesigner.MudEngine.Attributes; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; using ManagedScripting; @@ -20,165 +20,10 @@ namespace MudDesigner.Editors public partial class ZoneBuilder : Form { internal bool IsEditingExisting = false; - + public ZoneBuilder() { InitializeComponent(); - string realmPath = FileManager.GetDataPath(SaveDataTypes.Realms); - string[] realms = System.IO.Directory.GetFiles(realmPath, "*.realm"); - comRealms.DataSource = realms; - - if (comRealms.Items.Count != 0) - comRealms.SelectedIndex = comRealms.Items.IndexOf(Program.Zone.Realm); - } - - private void btnRoomEditor_Click(object sender, EventArgs e) - { - RoomDesigner form = new RoomDesigner(this); - if (!btnRoomEditor.Text.Equals("Build A Room")) - { - form.IsEditingExisting = true; - } - - form.Show(); - this.Hide(); - - while (form.Created) - { - Application.DoEvents(); - } - - form = null; - - this.Show(); - propertyRoom.SelectedObject = Program.Room; - } - - private void btnSaveZone_Click(object sender, EventArgs e) - { - //build the save file name - string path = FileManager.GetDataPath(SaveDataTypes.Zones); - string zoneFile = System.IO.Path.Combine(path, Program.Zone.Filename); - path = FileManager.GetDataPath(SaveDataTypes.Realms); - string realmFile = System.IO.Path.Combine(path, Program.Realm.Filename); - - //get a copy of the currently running (but hidden) realm explorer - RealmExplorer form = (RealmExplorer)Program.CurrentEditor; - - //Check if the currently selected realm currently contains the zone already - //in its lists of zones. It could already be there and the user is just editing it. - if (!form.lstZones.Items.Contains(Program.Zone.Name)) - form.lstZones.Items.Add(Program.Zone.Name); - - //Set the zones owning realm to the current realm - Program.Zone.Realm = Program.Realm.Name; - - //Add the zone to the realms zone collection - if (!Program.Realm.Zones.Contains(Program.Realm.GetZone(Program.Zone.Name))) - Program.Realm.Zones.Add(Program.Zone); - - //Save the zone and modified realm. - FileManager.Save(zoneFile, Program.Zone); - FileManager.Save(realmFile, Program.Realm); - - //Reset the zone and room - Program.Zone = new Zone(); - Program.Room = new Room(); - propertyZone.SelectedObject = Program.Zone; - - this.Close(); - } - - private void btnValidateScript_Click(object sender, EventArgs e) - { - Program.ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler; - Program.ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll"); - - string code = "namespace MudDesigner.MudEngine.Objects.Environment\n" - + "{\n" - + " public class " + Program.Zone.Name.Replace(" ", "") + " : Zone\n" - + " {\n" - + " " + txtScript.Text + "\n" - + " }\n" - + "}\n"; - MessageBox.Show(Program.ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - - private void ZoneBuilder_Load(object sender, EventArgs e) - { - Program.Room = new Room(); - Program.Zone = new Zone(); - Program.ScriptEngine = new ScriptingEngine(); - Program.ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory; - Program.ScriptEngine.Compiler = ScriptingEngine.CompilerSelections.SourceCompiler; - - if (IsEditingExisting) - { - string path = FileManager.GetDataPath(SaveDataTypes.Zones); - RealmExplorer form = (RealmExplorer)Program.CurrentEditor; - string zoneFile = form.lstZones.SelectedItem.ToString() + ".zone"; - string fullFilePath = System.IO.Path.Combine(path, zoneFile); - - Program.Zone = (Zone)FileManager.Load(fullFilePath, Program.Zone); - } - - propertyZone.SelectedObject = Program.Zone; - txtScript.Text = Program.Zone.Script; - - string[] rooms = System.IO.Directory.GetFiles(FileManager.GetDataPath(SaveDataTypes.Rooms), "*.room"); - - foreach (string room in rooms) - { - lstRooms.Items.Add(System.IO.Path.GetFileNameWithoutExtension(room)); - } - - } - - private void txtScript_TextChanged(object sender, EventArgs e) - { - Program.Zone.Script = txtScript.Text; - } - - private void btnCloseBuilder_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void lstRooms_SelectedIndexChanged(object sender, EventArgs e) - { - if (lstRooms.SelectedIndex == -1) - return; - - btnRoomEditor.Text = "Edit Selected Room"; - - string roomPath = FileManager.GetDataPath(SaveDataTypes.Rooms); - string roomFile = System.IO.Path.Combine(roomPath, lstRooms.SelectedItem.ToString() + ".room"); - Program.Room = (Room)FileManager.Load(roomFile, Program.Room); - //propertyRoom.Enabled = true; - propertyRoom.SelectedObject = Program.Room; - } - - private void btnUnselectRoom_Click(object sender, EventArgs e) - { - lstRooms.SelectedIndex = -1; - btnRoomEditor.Text = "Build A Room"; - Program.Room = new Room(); - propertyRoom.SelectedObject = null; - } - - private void btnCurrentRealm_Click(object sender, EventArgs e) - { - comRealms.SelectedIndex = comRealms.Items.IndexOf(Program.Zone.Realm); - } - - private void comRealms_SelectedIndexChanged(object sender, EventArgs e) - { - if (comRealms.SelectedIndex == -1) - return; - - string zonePath = FileManager.GetDataPath(SaveDataTypes.Zones); - string[] zones = System.IO.Directory.GetFiles(zonePath, "*.zone"); - lstZonesInRealm.DataSource = zones; } } } diff --git a/Mud Designer/Editors/ZoneBuilder.designer.cs b/Mud Designer/Editors/ZoneBuilder.designer.cs index 7116656..fceadbe 100644 --- a/Mud Designer/Editors/ZoneBuilder.designer.cs +++ b/Mud Designer/Editors/ZoneBuilder.designer.cs @@ -28,529 +28,144 @@ /// private void InitializeComponent() { - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.propertyZone = new System.Windows.Forms.PropertyGrid(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.btnCloseBuilder = new System.Windows.Forms.Button(); - this.btnSaveZone = new System.Windows.Forms.Button(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabZoneCreation = new System.Windows.Forms.TabPage(); - this.tabScript = new System.Windows.Forms.TabPage(); - this.txtScript = new System.Windows.Forms.RichTextBox(); - this.btnValidateScript = new System.Windows.Forms.Button(); + this.components = new System.ComponentModel.Container(); + this.containerMain = new System.Windows.Forms.SplitContainer(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnUnselectRoom = new System.Windows.Forms.Button(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.btnRoomEditor = new System.Windows.Forms.Button(); - this.lstRooms = new System.Windows.Forms.ListBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.propertyRoom = new System.Windows.Forms.PropertyGrid(); - this.btnNorth = new System.Windows.Forms.Button(); - this.btnWest = new System.Windows.Forms.Button(); - this.btnEast = new System.Windows.Forms.Button(); - this.btnSouth = new System.Windows.Forms.Button(); - this.btnUp = new System.Windows.Forms.Button(); - this.btnDown = new System.Windows.Forms.Button(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.containerAvailableRooms = new System.Windows.Forms.SplitContainer(); - this.comRealms = new System.Windows.Forms.ComboBox(); - this.btnCurrentRealm = new System.Windows.Forms.Button(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.lstZonesInRealm = new System.Windows.Forms.ListBox(); - this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.lstRoomsInZone = new System.Windows.Forms.ListBox(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tabZoneCreation.SuspendLayout(); - this.tabScript.SuspendLayout(); + this.btnLoadRealm = new System.Windows.Forms.Button(); + this.btnSaveRealm = new System.Windows.Forms.Button(); + this.btnDeleteRealm = new System.Windows.Forms.Button(); + this.btnNewRealm = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.lstZones = new System.Windows.Forms.ListBox(); + this.containerMain.Panel1.SuspendLayout(); + this.containerMain.SuspendLayout(); this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - this.groupBox4.SuspendLayout(); - this.groupBox5.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.containerAvailableRooms.Panel1.SuspendLayout(); - this.containerAvailableRooms.Panel2.SuspendLayout(); - this.containerAvailableRooms.SuspendLayout(); - this.groupBox7.SuspendLayout(); - this.groupBox8.SuspendLayout(); + this.groupBox1.SuspendLayout(); this.SuspendLayout(); // - // splitContainer1 + // containerMain // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; + this.containerMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.containerMain.Location = new System.Drawing.Point(0, 0); + this.containerMain.Name = "containerMain"; // - // splitContainer1.Panel1 + // containerMain.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.propertyZone); - this.splitContainer1.Panel1.Controls.Add(this.groupBox1); + this.containerMain.Panel1.Controls.Add(this.groupBox1); + this.containerMain.Panel1.Controls.Add(this.groupBox2); + this.containerMain.Size = new System.Drawing.Size(758, 471); + this.containerMain.SplitterDistance = 203; + this.containerMain.TabIndex = 0; // - // splitContainer1.Panel2 + // toolTip1 // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); - this.splitContainer1.Size = new System.Drawing.Size(794, 574); - this.splitContainer1.SplitterDistance = 238; - this.splitContainer1.TabIndex = 0; - // - // propertyZone - // - this.propertyZone.Dock = System.Windows.Forms.DockStyle.Fill; - this.propertyZone.Location = new System.Drawing.Point(0, 71); - this.propertyZone.Name = "propertyZone"; - this.propertyZone.Size = new System.Drawing.Size(238, 503); - this.propertyZone.TabIndex = 1; - this.propertyZone.ToolbarVisible = false; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.btnCloseBuilder); - this.groupBox1.Controls.Add(this.btnSaveZone); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; - this.groupBox1.Location = new System.Drawing.Point(0, 0); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(238, 71); - this.groupBox1.TabIndex = 0; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Zone Setup"; - // - // btnCloseBuilder - // - this.btnCloseBuilder.Dock = System.Windows.Forms.DockStyle.Top; - this.btnCloseBuilder.Location = new System.Drawing.Point(3, 39); - this.btnCloseBuilder.Name = "btnCloseBuilder"; - this.btnCloseBuilder.Size = new System.Drawing.Size(232, 23); - this.btnCloseBuilder.TabIndex = 12; - this.btnCloseBuilder.Text = "Close Builder"; - this.btnCloseBuilder.UseVisualStyleBackColor = true; - this.btnCloseBuilder.Click += new System.EventHandler(this.btnCloseBuilder_Click); - // - // btnSaveZone - // - this.btnSaveZone.Dock = System.Windows.Forms.DockStyle.Top; - this.btnSaveZone.Location = new System.Drawing.Point(3, 16); - this.btnSaveZone.Name = "btnSaveZone"; - this.btnSaveZone.Size = new System.Drawing.Size(232, 23); - this.btnSaveZone.TabIndex = 11; - this.btnSaveZone.Text = "Save Zone"; - this.btnSaveZone.UseVisualStyleBackColor = true; - this.btnSaveZone.Click += new System.EventHandler(this.btnSaveZone_Click); - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.tabControl1); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.groupBox4); - this.splitContainer2.Panel2.Controls.Add(this.groupBox2); - this.splitContainer2.Size = new System.Drawing.Size(552, 574); - this.splitContainer2.SplitterDistance = 347; - this.splitContainer2.TabIndex = 0; - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tabZoneCreation); - this.tabControl1.Controls.Add(this.tabScript); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(347, 574); - this.tabControl1.TabIndex = 0; - // - // tabZoneCreation - // - this.tabZoneCreation.Controls.Add(this.groupBox5); - this.tabZoneCreation.Controls.Add(this.groupBox3); - this.tabZoneCreation.Location = new System.Drawing.Point(4, 22); - this.tabZoneCreation.Name = "tabZoneCreation"; - this.tabZoneCreation.Padding = new System.Windows.Forms.Padding(3); - this.tabZoneCreation.Size = new System.Drawing.Size(339, 548); - this.tabZoneCreation.TabIndex = 0; - this.tabZoneCreation.Text = "Zone Creation"; - this.tabZoneCreation.UseVisualStyleBackColor = true; - // - // tabScript - // - this.tabScript.Controls.Add(this.txtScript); - this.tabScript.Controls.Add(this.btnValidateScript); - this.tabScript.Location = new System.Drawing.Point(4, 22); - this.tabScript.Name = "tabScript"; - this.tabScript.Padding = new System.Windows.Forms.Padding(3); - this.tabScript.Size = new System.Drawing.Size(357, 548); - this.tabScript.TabIndex = 1; - this.tabScript.Text = "Script"; - this.tabScript.UseVisualStyleBackColor = true; - // - // txtScript - // - this.txtScript.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtScript.Location = new System.Drawing.Point(3, 26); - this.txtScript.Name = "txtScript"; - this.txtScript.Size = new System.Drawing.Size(351, 519); - this.txtScript.TabIndex = 15; - this.txtScript.Text = ""; - this.txtScript.TextChanged += new System.EventHandler(this.txtScript_TextChanged); - // - // btnValidateScript - // - this.btnValidateScript.Dock = System.Windows.Forms.DockStyle.Top; - this.btnValidateScript.Location = new System.Drawing.Point(3, 3); - this.btnValidateScript.Name = "btnValidateScript"; - this.btnValidateScript.Size = new System.Drawing.Size(351, 23); - this.btnValidateScript.TabIndex = 14; - this.btnValidateScript.Text = "Validate Script"; - this.btnValidateScript.UseVisualStyleBackColor = true; - this.btnValidateScript.Click += new System.EventHandler(this.btnValidateScript_Click); + this.toolTip1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + this.toolTip1.IsBalloon = true; + this.toolTip1.ToolTipTitle = "Zone Designer"; // // groupBox2 // - this.groupBox2.Controls.Add(this.lstRooms); - this.groupBox2.Controls.Add(this.btnRoomEditor); - this.groupBox2.Controls.Add(this.btnUnselectRoom); + this.groupBox2.Controls.Add(this.btnLoadRealm); + this.groupBox2.Controls.Add(this.btnSaveRealm); + this.groupBox2.Controls.Add(this.btnDeleteRealm); + this.groupBox2.Controls.Add(this.btnNewRealm); this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox2.Location = new System.Drawing.Point(0, 0); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(201, 303); - this.groupBox2.TabIndex = 0; + this.groupBox2.Size = new System.Drawing.Size(203, 76); + this.groupBox2.TabIndex = 35; this.groupBox2.TabStop = false; - this.groupBox2.Text = "Available Rooms"; + this.groupBox2.Text = "Zone Setup"; // - // btnUnselectRoom + // btnLoadRealm // - this.btnUnselectRoom.Dock = System.Windows.Forms.DockStyle.Bottom; - this.btnUnselectRoom.Location = new System.Drawing.Point(3, 277); - this.btnUnselectRoom.Name = "btnUnselectRoom"; - this.btnUnselectRoom.Size = new System.Drawing.Size(195, 23); - this.btnUnselectRoom.TabIndex = 2; - this.btnUnselectRoom.Text = "Unselect Room"; - this.btnUnselectRoom.UseVisualStyleBackColor = true; - this.btnUnselectRoom.Click += new System.EventHandler(this.btnUnselectRoom_Click); + this.btnLoadRealm.Location = new System.Drawing.Point(106, 19); + this.btnLoadRealm.Name = "btnLoadRealm"; + this.btnLoadRealm.Size = new System.Drawing.Size(85, 23); + this.btnLoadRealm.TabIndex = 11; + this.btnLoadRealm.Text = "Load Zone"; + this.btnLoadRealm.UseVisualStyleBackColor = true; // - // groupBox3 + // btnSaveRealm // - this.groupBox3.Controls.Add(this.btnDown); - this.groupBox3.Controls.Add(this.btnUp); - this.groupBox3.Controls.Add(this.btnSouth); - this.groupBox3.Controls.Add(this.btnEast); - this.groupBox3.Controls.Add(this.btnWest); - this.groupBox3.Controls.Add(this.btnNorth); - this.groupBox3.Location = new System.Drawing.Point(3, 6); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(333, 236); - this.groupBox3.TabIndex = 0; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Room Installed Doorways"; + this.btnSaveRealm.Location = new System.Drawing.Point(107, 48); + this.btnSaveRealm.Name = "btnSaveRealm"; + this.btnSaveRealm.Size = new System.Drawing.Size(84, 23); + this.btnSaveRealm.TabIndex = 10; + this.btnSaveRealm.Text = "Save Zone"; + this.btnSaveRealm.UseVisualStyleBackColor = true; // - // btnRoomEditor + // btnDeleteRealm // - this.btnRoomEditor.Dock = System.Windows.Forms.DockStyle.Bottom; - this.btnRoomEditor.Location = new System.Drawing.Point(3, 254); - this.btnRoomEditor.Name = "btnRoomEditor"; - this.btnRoomEditor.Size = new System.Drawing.Size(195, 23); - this.btnRoomEditor.TabIndex = 4; - this.btnRoomEditor.Text = "Build A Room"; - this.btnRoomEditor.UseVisualStyleBackColor = true; - this.btnRoomEditor.Click += new System.EventHandler(this.btnRoomEditor_Click); + this.btnDeleteRealm.Location = new System.Drawing.Point(6, 48); + this.btnDeleteRealm.Name = "btnDeleteRealm"; + this.btnDeleteRealm.Size = new System.Drawing.Size(85, 23); + this.btnDeleteRealm.TabIndex = 9; + this.btnDeleteRealm.Text = "Delete Zone"; + this.btnDeleteRealm.UseVisualStyleBackColor = true; // - // lstRooms + // btnNewRealm // - this.lstRooms.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstRooms.FormattingEnabled = true; - this.lstRooms.Location = new System.Drawing.Point(3, 16); - this.lstRooms.Name = "lstRooms"; - this.lstRooms.Size = new System.Drawing.Size(195, 238); - this.lstRooms.Sorted = true; - this.lstRooms.TabIndex = 5; - this.lstRooms.SelectedIndexChanged += new System.EventHandler(this.lstRooms_SelectedIndexChanged); + this.btnNewRealm.Location = new System.Drawing.Point(6, 19); + this.btnNewRealm.Name = "btnNewRealm"; + this.btnNewRealm.Size = new System.Drawing.Size(85, 23); + this.btnNewRealm.TabIndex = 8; + this.btnNewRealm.Text = "New Zone"; + this.btnNewRealm.UseVisualStyleBackColor = true; // - // groupBox4 + // groupBox1 // - this.groupBox4.Controls.Add(this.propertyRoom); - this.groupBox4.Dock = System.Windows.Forms.DockStyle.Bottom; - this.groupBox4.Location = new System.Drawing.Point(0, 306); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(201, 268); - this.groupBox4.TabIndex = 1; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Room Preview"; + this.groupBox1.Controls.Add(this.lstZones); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 76); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(203, 395); + this.groupBox1.TabIndex = 37; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Zone List"; // - // propertyRoom + // lstZones // - this.propertyRoom.Dock = System.Windows.Forms.DockStyle.Fill; - this.propertyRoom.Enabled = false; - this.propertyRoom.HelpVisible = false; - this.propertyRoom.Location = new System.Drawing.Point(3, 16); - this.propertyRoom.Name = "propertyRoom"; - this.propertyRoom.Size = new System.Drawing.Size(195, 249); - this.propertyRoom.TabIndex = 0; - this.propertyRoom.ToolbarVisible = false; - // - // btnNorth - // - this.btnNorth.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnNorth.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnNorth.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnNorth.Location = new System.Drawing.Point(124, 19); - this.btnNorth.Name = "btnNorth"; - this.btnNorth.Size = new System.Drawing.Size(85, 56); - this.btnNorth.TabIndex = 0; - this.btnNorth.Text = "North"; - this.btnNorth.UseVisualStyleBackColor = false; - // - // btnWest - // - this.btnWest.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnWest.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnWest.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnWest.Location = new System.Drawing.Point(6, 60); - this.btnWest.Name = "btnWest"; - this.btnWest.Size = new System.Drawing.Size(85, 56); - this.btnWest.TabIndex = 1; - this.btnWest.Text = "West"; - this.btnWest.UseVisualStyleBackColor = false; - // - // btnEast - // - this.btnEast.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnEast.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnEast.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnEast.Location = new System.Drawing.Point(242, 60); - this.btnEast.Name = "btnEast"; - this.btnEast.Size = new System.Drawing.Size(85, 56); - this.btnEast.TabIndex = 2; - this.btnEast.Text = "East"; - this.btnEast.UseVisualStyleBackColor = false; - // - // btnSouth - // - this.btnSouth.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnSouth.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSouth.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSouth.Location = new System.Drawing.Point(124, 114); - this.btnSouth.Name = "btnSouth"; - this.btnSouth.Size = new System.Drawing.Size(85, 56); - this.btnSouth.TabIndex = 3; - this.btnSouth.Text = "South"; - this.btnSouth.UseVisualStyleBackColor = false; - // - // btnUp - // - this.btnUp.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnUp.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnUp.Location = new System.Drawing.Point(6, 170); - this.btnUp.Name = "btnUp"; - this.btnUp.Size = new System.Drawing.Size(85, 56); - this.btnUp.TabIndex = 4; - this.btnUp.Text = "Up"; - this.btnUp.UseVisualStyleBackColor = false; - // - // btnDown - // - this.btnDown.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.btnDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnDown.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnDown.Location = new System.Drawing.Point(242, 170); - this.btnDown.Name = "btnDown"; - this.btnDown.Size = new System.Drawing.Size(85, 56); - this.btnDown.TabIndex = 5; - this.btnDown.Text = "Down"; - this.btnDown.UseVisualStyleBackColor = false; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.groupBox8); - this.groupBox5.Controls.Add(this.groupBox7); - this.groupBox5.Controls.Add(this.groupBox6); - this.groupBox5.Location = new System.Drawing.Point(3, 248); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(333, 297); - this.groupBox5.TabIndex = 1; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Available Rooms"; - // - // groupBox6 - // - this.groupBox6.Controls.Add(this.containerAvailableRooms); - this.groupBox6.Dock = System.Windows.Forms.DockStyle.Top; - this.groupBox6.Location = new System.Drawing.Point(3, 16); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(327, 43); - this.groupBox6.TabIndex = 0; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "Realms"; - // - // containerAvailableRooms - // - this.containerAvailableRooms.Dock = System.Windows.Forms.DockStyle.Fill; - this.containerAvailableRooms.Location = new System.Drawing.Point(3, 16); - this.containerAvailableRooms.Name = "containerAvailableRooms"; - // - // containerAvailableRooms.Panel1 - // - this.containerAvailableRooms.Panel1.Controls.Add(this.comRealms); - // - // containerAvailableRooms.Panel2 - // - this.containerAvailableRooms.Panel2.Controls.Add(this.btnCurrentRealm); - this.containerAvailableRooms.Size = new System.Drawing.Size(321, 24); - this.containerAvailableRooms.SplitterDistance = 191; - this.containerAvailableRooms.TabIndex = 0; - // - // comRealms - // - this.comRealms.Dock = System.Windows.Forms.DockStyle.Fill; - this.comRealms.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comRealms.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.comRealms.FormattingEnabled = true; - this.comRealms.Location = new System.Drawing.Point(0, 0); - this.comRealms.Name = "comRealms"; - this.comRealms.Size = new System.Drawing.Size(191, 21); - this.comRealms.Sorted = true; - this.comRealms.TabIndex = 1; - this.comRealms.SelectedIndexChanged += new System.EventHandler(this.comRealms_SelectedIndexChanged); - // - // btnCurrentRealm - // - this.btnCurrentRealm.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnCurrentRealm.Location = new System.Drawing.Point(0, 0); - this.btnCurrentRealm.Name = "btnCurrentRealm"; - this.btnCurrentRealm.Size = new System.Drawing.Size(126, 24); - this.btnCurrentRealm.TabIndex = 0; - this.btnCurrentRealm.Text = "Select Owning Realm"; - this.btnCurrentRealm.UseVisualStyleBackColor = true; - this.btnCurrentRealm.Click += new System.EventHandler(this.btnCurrentRealm_Click); - // - // groupBox7 - // - this.groupBox7.Controls.Add(this.lstZonesInRealm); - this.groupBox7.Dock = System.Windows.Forms.DockStyle.Top; - this.groupBox7.Location = new System.Drawing.Point(3, 59); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(327, 105); - this.groupBox7.TabIndex = 2; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "Zones Within Selected Realm"; - // - // lstZonesInRealm - // - this.lstZonesInRealm.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstZonesInRealm.FormattingEnabled = true; - this.lstZonesInRealm.Location = new System.Drawing.Point(3, 16); - this.lstZonesInRealm.Name = "lstZonesInRealm"; - this.lstZonesInRealm.Size = new System.Drawing.Size(321, 82); - this.lstZonesInRealm.Sorted = true; - this.lstZonesInRealm.TabIndex = 0; - // - // groupBox8 - // - this.groupBox8.Controls.Add(this.lstRoomsInZone); - this.groupBox8.Dock = System.Windows.Forms.DockStyle.Top; - this.groupBox8.Location = new System.Drawing.Point(3, 164); - this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(327, 127); - this.groupBox8.TabIndex = 3; - this.groupBox8.TabStop = false; - this.groupBox8.Text = "Rooms within Selected Zone"; - // - // lstRoomsInZone - // - this.lstRoomsInZone.Dock = System.Windows.Forms.DockStyle.Fill; - this.lstRoomsInZone.FormattingEnabled = true; - this.lstRoomsInZone.Location = new System.Drawing.Point(3, 16); - this.lstRoomsInZone.Name = "lstRoomsInZone"; - this.lstRoomsInZone.Size = new System.Drawing.Size(321, 108); - this.lstRoomsInZone.Sorted = true; - this.lstRoomsInZone.TabIndex = 0; + this.lstZones.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstZones.FormattingEnabled = true; + this.lstZones.Location = new System.Drawing.Point(3, 16); + this.lstZones.Name = "lstZones"; + this.lstZones.Size = new System.Drawing.Size(197, 368); + this.lstZones.Sorted = true; + this.lstZones.TabIndex = 17; // // ZoneBuilder // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(794, 574); - this.Controls.Add(this.splitContainer1); + this.ClientSize = new System.Drawing.Size(758, 471); + this.Controls.Add(this.containerMain); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ZoneBuilder"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Zone Builder"; - this.Load += new System.EventHandler(this.ZoneBuilder_Load); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.tabControl1.ResumeLayout(false); - this.tabZoneCreation.ResumeLayout(false); - this.tabScript.ResumeLayout(false); + this.containerMain.Panel1.ResumeLayout(false); + this.containerMain.ResumeLayout(false); this.groupBox2.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); - this.groupBox4.ResumeLayout(false); - this.groupBox5.ResumeLayout(false); - this.groupBox6.ResumeLayout(false); - this.containerAvailableRooms.Panel1.ResumeLayout(false); - this.containerAvailableRooms.Panel2.ResumeLayout(false); - this.containerAvailableRooms.ResumeLayout(false); - this.groupBox7.ResumeLayout(false); - this.groupBox8.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Button btnSaveZone; - private System.Windows.Forms.PropertyGrid propertyZone; - private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.SplitContainer containerMain; + private System.Windows.Forms.ToolTip toolTip1; private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabZoneCreation; - private System.Windows.Forms.TabPage tabScript; - private System.Windows.Forms.RichTextBox txtScript; - private System.Windows.Forms.Button btnValidateScript; - private System.Windows.Forms.Button btnCloseBuilder; - private System.Windows.Forms.Button btnUnselectRoom; - private System.Windows.Forms.GroupBox groupBox3; - public System.Windows.Forms.ListBox lstRooms; - private System.Windows.Forms.Button btnRoomEditor; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.PropertyGrid propertyRoom; - private System.Windows.Forms.Button btnNorth; - private System.Windows.Forms.Button btnSouth; - private System.Windows.Forms.Button btnEast; - private System.Windows.Forms.Button btnWest; - private System.Windows.Forms.Button btnDown; - private System.Windows.Forms.Button btnUp; - private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.GroupBox groupBox6; - private System.Windows.Forms.SplitContainer containerAvailableRooms; - private System.Windows.Forms.ComboBox comRealms; - private System.Windows.Forms.Button btnCurrentRealm; - private System.Windows.Forms.GroupBox groupBox7; - private System.Windows.Forms.ListBox lstZonesInRealm; - private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.ListBox lstRoomsInZone; + private System.Windows.Forms.Button btnLoadRealm; + private System.Windows.Forms.Button btnSaveRealm; + private System.Windows.Forms.Button btnDeleteRealm; + private System.Windows.Forms.Button btnNewRealm; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.ListBox lstZones; } } \ No newline at end of file diff --git a/Mud Designer/Editors/ZoneBuilder.resx b/Mud Designer/Editors/ZoneBuilder.resx index ff31a6d..7ce03af 100644 --- a/Mud Designer/Editors/ZoneBuilder.resx +++ b/Mud Designer/Editors/ZoneBuilder.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/Mud Designer/Mud Designer.csproj b/Mud Designer/Mud Designer.csproj index ab8bd0c..f2778e8 100644 --- a/Mud Designer/Mud Designer.csproj +++ b/Mud Designer/Mud Designer.csproj @@ -59,18 +59,20 @@ ExistingRealms.cs + - + - + + - + Form @@ -90,12 +92,6 @@ ToolkitLauncher.cs - - Form - - - RoomDesigner.cs - Form @@ -109,7 +105,7 @@ ProjectSettings.cs - + @@ -128,10 +124,6 @@ ToolkitLauncher.cs Designer - - RoomDesigner.cs - Designer - RealmExplorer.cs Designer diff --git a/Mud Designer/MudEngine/FileSystem/FileManager.cs b/Mud Designer/MudEngine/FileSystem/FileManager.cs index 0223f14..17edec9 100644 --- a/Mud Designer/MudEngine/FileSystem/FileManager.cs +++ b/Mud Designer/MudEngine/FileSystem/FileManager.cs @@ -105,5 +105,21 @@ namespace MudDesigner.MudEngine.FileSystem else return System.IO.Path.Combine(rootPath, DataType.ToString()); } + + public static string GetDataPath(string Realm, string Zone) + { + string assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName; + string assemblyName = System.IO.Path.GetFileName(assemblyPath); + string installBase = assemblyPath.Substring(0, assemblyPath.Length - assemblyName.Length); + string rootPath = System.IO.Path.Combine(installBase, "Data"); + string realmsPath = System.IO.Path.Combine(rootPath, Realm); + + return System.IO.Path.Combine(realmsPath, Zone); + } + + public static string GetDataPath(string Realm, string Zone, string Room) + { + return System.IO.Path.Combine(GetDataPath(Realm, Zone), Room); + } } } diff --git a/Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs b/Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs index 22b1b75..f77267b 100644 --- a/Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs +++ b/Mud Designer/MudEngine/FileSystem/SaveDataTypes.cs @@ -4,8 +4,6 @@ { Root, Currency, - Rooms, - Zones, Realms, } } \ No newline at end of file diff --git a/Mud Designer/MudEngine/GameObjects/BaseObject.cs b/Mud Designer/MudEngine/GameObjects/BaseObject.cs index 51ea76a..2391b4c 100644 --- a/Mud Designer/MudEngine/GameObjects/BaseObject.cs +++ b/Mud Designer/MudEngine/GameObjects/BaseObject.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; using System.Xml.Serialization; using MudDesigner.MudEngine.Interfaces; -namespace MudDesigner.MudEngine.Objects +namespace MudDesigner.MudEngine.GameObjects { public class BaseObject : IGameObject { @@ -15,8 +15,15 @@ namespace MudDesigner.MudEngine.Objects [RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid public string Name { - get; - set; + get + { + return this._Name; + } + set + { + this._Name = value; + this.Filename = value + ".realm"; + } } [Category("Object Setup")] @@ -29,20 +36,27 @@ namespace MudDesigner.MudEngine.Objects [Browsable(false)] public string Script { get; set; } - [ReadOnly(true)] [Category("Object Setup")] + [DefaultValue("New Realm.realm")] public string Filename { //Returns the name of the object + the objects Type as it's extension. //Filenames are generated by the class itself, users can not assign it. get { - string fileExtension = this.GetType().Name.ToLower(); + return this._Filename; + } + set + { + if (!value.EndsWith(".realm")) + value += ".realm"; - return this.Name + "." + fileExtension; + this._Filename = value; } } + private string _Filename = "New Realm.realm"; + private string _Name = "New Realm"; /// /// Initializes the base object /// diff --git a/Mud Designer/MudEngine/GameObjects/Currency.cs b/Mud Designer/MudEngine/GameObjects/Currency.cs index 0a7253e..473df5e 100644 --- a/Mud Designer/MudEngine/GameObjects/Currency.cs +++ b/Mud Designer/MudEngine/GameObjects/Currency.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.ComponentModel; -namespace MudDesigner.MudEngine.Objects +namespace MudDesigner.MudEngine.GameObjects { public class Currency : BaseObject { diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Door.cs b/Mud Designer/MudEngine/GameObjects/Environment/Door.cs index efc9936..9d7316f 100644 --- a/Mud Designer/MudEngine/GameObjects/Environment/Door.cs +++ b/Mud Designer/MudEngine/GameObjects/Environment/Door.cs @@ -5,7 +5,7 @@ using System.Text; using System.ComponentModel; -namespace MudDesigner.MudEngine.Objects.Environment +namespace MudDesigner.MudEngine.GameObjects.Environment { public class Door { @@ -38,6 +38,15 @@ namespace MudDesigner.MudEngine.Objects.Environment set; } + [Category("Door Settings")] + [DefaultValue(false)] + public bool IsRealmEntrance + { get; set; } + + [Category("Door Settings")] + [DefaultValue(false)] + public bool IsRealmExit { get; set; } + [Category("Door Settings")] [Description("Sets if the door is installed and useable within the room or not.")] [DefaultValue(AvailableDoorStates.Uninstalled)] diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Realm.cs b/Mud Designer/MudEngine/GameObjects/Environment/Realm.cs index ddc89b7..6da0740 100644 --- a/Mud Designer/MudEngine/GameObjects/Environment/Realm.cs +++ b/Mud Designer/MudEngine/GameObjects/Environment/Realm.cs @@ -2,25 +2,44 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.IO; +using System.ComponentModel; -namespace MudDesigner.MudEngine.Objects.Environment +using MudDesigner.MudEngine.FileSystem; +using MudDesigner.MudEngine.GameObjects; + +namespace MudDesigner.MudEngine.GameObjects.Environment { public class Realm : BaseObject { - [System.ComponentModel.Browsable(false)] - public List Zones { get; set; } + [Browsable(false)] + public List Zones { get; set; } public Realm() { - Zones = new List(); + Zones = new List(); } public Zone GetZone(string ZoneName) { - foreach(Zone zone in Zones) + //correct the zonename if needed + if (!ZoneName.EndsWith(".zone")) + ZoneName += ".zone"; + + //build our path + string realmPath = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Realms), this.Name); + + //get a collection of all the zones within the realm + string[] files = Directory.GetFiles(realmPath, "*.zone"); + Zone zone = new Zone(); + + //look four our zone file + foreach (string file in files) { - if (zone.Name == ZoneName) - return zone; + if (file == ZoneName) + { + string zonePath = Path.Combine(realmPath, Path.GetDirectoryName(file)); + } } return null; diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Room.cs b/Mud Designer/MudEngine/GameObjects/Environment/Room.cs index bf84b5f..7041b26 100644 --- a/Mud Designer/MudEngine/GameObjects/Environment/Room.cs +++ b/Mud Designer/MudEngine/GameObjects/Environment/Room.cs @@ -5,7 +5,7 @@ using System.Text; using System.ComponentModel; using System.Xml.Serialization; -namespace MudDesigner.MudEngine.Objects.Environment +namespace MudDesigner.MudEngine.GameObjects.Environment { public class Room : BaseObject { @@ -57,9 +57,39 @@ namespace MudDesigner.MudEngine.Objects.Environment set; } + [Category("Room Information")] + [ReadOnly(true)] + public string DoorList + { + get + { + string installed = ""; + if (this.InstalledDoors.Count != 0) + { + foreach (Door d in InstalledDoors) + { + installed += d.TravelDirection.ToString() + ","; + } + if (InstalledDoors.Count >= 2) + { + installed = installed.Substring(0, installed.Length - 1); + } + return installed; + } + else + return "None Installed."; + } + } + [Browsable(false)] public List InstalledDoors; + [Browsable(false)] + public string ParentZone + { + get; + set; + } public Room() { InstalledDoors = new List(); diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs b/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs index 849a975..647fed0 100644 --- a/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs +++ b/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace MudDesigner.MudEngine.Objects.Environment +namespace MudDesigner.MudEngine.GameObjects.Environment { public class Zone : BaseObject { diff --git a/Mud Designer/MudEngine/Interfaces/IQuest.cs b/Mud Designer/MudEngine/Interfaces/IQuest.cs index 1a11fd8..2ea73cf 100644 --- a/Mud Designer/MudEngine/Interfaces/IQuest.cs +++ b/Mud Designer/MudEngine/Interfaces/IQuest.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using MudDesigner.MudEngine.Objects; +using MudDesigner.MudEngine.GameObjects; namespace MudDesigner.MudEngine.Interfaces { interface IQuest diff --git a/Mud Designer/Program.cs b/Mud Designer/Program.cs index cda248d..2d5c1fe 100644 --- a/Mud Designer/Program.cs +++ b/Mud Designer/Program.cs @@ -6,8 +6,12 @@ using System.Windows.Forms; using MudDesigner.MudEngine; using MudDesigner.MudEngine.Attributes; using MudDesigner.MudEngine.FileSystem; -using MudDesigner.MudEngine.Objects; -using MudDesigner.MudEngine.Objects.Environment; +using MudDesigner.MudEngine.GameManagement; +using MudDesigner.MudEngine.GameObjects; +using MudDesigner.MudEngine.GameObjects.Environment; +//Script Engine +using ManagedScripting; +using ManagedScripting.CodeBuilding; namespace MudDesigner { @@ -17,7 +21,7 @@ namespace MudDesigner public static Realm Realm { get; set; } public static Zone Zone {get;set;} public static Room Room { get; set; } - public static ManagedScripting.ScriptingEngine ScriptEngine { get; set; } + public static ScriptingEngine ScriptEngine { get; set; } public static Form CurrentEditor { get; set; } ///