Project restructure completed. All editors now contained within a single Project.
Note that some things are still broken from the migration, but will be addressed.
This commit is contained in:
parent
ec48ae95c3
commit
b87136bc13
38 changed files with 4623 additions and 0 deletions
89
Mud Designer/Editors/CurrencyEditor.cs
Normal file
89
Mud Designer/Editors/CurrencyEditor.cs
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class CurrencyEditor : Form
|
||||||
|
{
|
||||||
|
Currency _Currency;
|
||||||
|
|
||||||
|
public CurrencyEditor()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_Currency = new Currency();
|
||||||
|
propertyGrid1.SelectedObject = _Currency;
|
||||||
|
foreach (string currency in System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Currency), "*.xml"))
|
||||||
|
{
|
||||||
|
lstCurrencies.Items.Add(System.IO.Path.GetFileNameWithoutExtension(currency));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnNewCurrency_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_Currency = new Currency();
|
||||||
|
propertyGrid1.SelectedObject = _Currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveCurrency_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lstCurrencies.Items.Contains(_Currency.Name))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Currency already exists!", "Currency Creation", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem.Save(Application.StartupPath + @"\Data\Currency\" + _Currency.Name + ".xml", _Currency);
|
||||||
|
lstCurrencies.Items.Add(_Currency.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void lstCurrencies_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//nothing selected.
|
||||||
|
if (lstCurrencies.SelectedIndex == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_Currency = (Currency)FileSystem.Load(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml", _Currency);
|
||||||
|
propertyGrid1.SelectedObject = _Currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnDeleteCurrency_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//Check if a currency is selected.
|
||||||
|
if (lstCurrencies.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Select a currency to delete first!", "Currency Deletion", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Ask if its ok to delete first.
|
||||||
|
DialogResult result = MessageBox.Show("Are you sure you want to delete " + _Currency.Name + "?",
|
||||||
|
"Currency Deletion",
|
||||||
|
MessageBoxButtons.YesNo,
|
||||||
|
MessageBoxIcon.Question);
|
||||||
|
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Delete the files and remove from the list.
|
||||||
|
System.IO.File.Delete(Application.StartupPath + @"\Data\Currency\" + lstCurrencies.SelectedItem.ToString() + ".xml");
|
||||||
|
lstCurrencies.Items.Remove(lstCurrencies.SelectedItem);
|
||||||
|
|
||||||
|
//Re-instance the currency and set it within the propertygrid.
|
||||||
|
_Currency = new Currency();
|
||||||
|
propertyGrid1.SelectedObject = _Currency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
161
Mud Designer/Editors/CurrencyEditor.designer.cs
generated
Normal file
161
Mud Designer/Editors/CurrencyEditor.designer.cs
generated
Normal file
|
@ -0,0 +1,161 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class CurrencyEditor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstCurrencies = new System.Windows.Forms.ListBox();
|
||||||
|
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnNewCurrency = new System.Windows.Forms.Button();
|
||||||
|
this.btnSaveCurrency = new System.Windows.Forms.Button();
|
||||||
|
this.btnDeleteCurrency = new System.Windows.Forms.Button();
|
||||||
|
this.groupBox2.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.groupBox3.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
this.groupBox2.Controls.Add(this.propertyGrid1);
|
||||||
|
this.groupBox2.Location = new System.Drawing.Point(1, 136);
|
||||||
|
this.groupBox2.Name = "groupBox2";
|
||||||
|
this.groupBox2.Size = new System.Drawing.Size(323, 214);
|
||||||
|
this.groupBox2.TabIndex = 6;
|
||||||
|
this.groupBox2.TabStop = false;
|
||||||
|
this.groupBox2.Text = "Currency Setup";
|
||||||
|
//
|
||||||
|
// propertyGrid1
|
||||||
|
//
|
||||||
|
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.propertyGrid1.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.propertyGrid1.Name = "propertyGrid1";
|
||||||
|
this.propertyGrid1.Size = new System.Drawing.Size(317, 195);
|
||||||
|
this.propertyGrid1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.lstCurrencies);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(1, 0);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(323, 130);
|
||||||
|
this.groupBox1.TabIndex = 5;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "Currencies";
|
||||||
|
//
|
||||||
|
// lstCurrencies
|
||||||
|
//
|
||||||
|
this.lstCurrencies.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lstCurrencies.FormattingEnabled = true;
|
||||||
|
this.lstCurrencies.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.lstCurrencies.Name = "lstCurrencies";
|
||||||
|
this.lstCurrencies.Size = new System.Drawing.Size(317, 108);
|
||||||
|
this.lstCurrencies.TabIndex = 0;
|
||||||
|
this.lstCurrencies.SelectedIndexChanged += new System.EventHandler(this.lstCurrencies_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// groupBox3
|
||||||
|
//
|
||||||
|
this.groupBox3.Controls.Add(this.btnDeleteCurrency);
|
||||||
|
this.groupBox3.Controls.Add(this.btnSaveCurrency);
|
||||||
|
this.groupBox3.Controls.Add(this.btnNewCurrency);
|
||||||
|
this.groupBox3.Location = new System.Drawing.Point(1, 353);
|
||||||
|
this.groupBox3.Name = "groupBox3";
|
||||||
|
this.groupBox3.Size = new System.Drawing.Size(323, 54);
|
||||||
|
this.groupBox3.TabIndex = 7;
|
||||||
|
this.groupBox3.TabStop = false;
|
||||||
|
this.groupBox3.Text = "Options";
|
||||||
|
//
|
||||||
|
// btnNewCurrency
|
||||||
|
//
|
||||||
|
this.btnNewCurrency.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnNewCurrency.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.btnNewCurrency.Name = "btnNewCurrency";
|
||||||
|
this.btnNewCurrency.Size = new System.Drawing.Size(100, 31);
|
||||||
|
this.btnNewCurrency.TabIndex = 0;
|
||||||
|
this.btnNewCurrency.Text = "New Currency";
|
||||||
|
this.btnNewCurrency.UseVisualStyleBackColor = true;
|
||||||
|
this.btnNewCurrency.Click += new System.EventHandler(this.btnNewCurrency_Click);
|
||||||
|
//
|
||||||
|
// btnSaveCurrency
|
||||||
|
//
|
||||||
|
this.btnSaveCurrency.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnSaveCurrency.Location = new System.Drawing.Point(109, 16);
|
||||||
|
this.btnSaveCurrency.Name = "btnSaveCurrency";
|
||||||
|
this.btnSaveCurrency.Size = new System.Drawing.Size(100, 31);
|
||||||
|
this.btnSaveCurrency.TabIndex = 1;
|
||||||
|
this.btnSaveCurrency.Text = "Save Currency";
|
||||||
|
this.btnSaveCurrency.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveCurrency.Click += new System.EventHandler(this.btnSaveCurrency_Click);
|
||||||
|
//
|
||||||
|
// btnDeleteCurrency
|
||||||
|
//
|
||||||
|
this.btnDeleteCurrency.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnDeleteCurrency.Location = new System.Drawing.Point(215, 16);
|
||||||
|
this.btnDeleteCurrency.Name = "btnDeleteCurrency";
|
||||||
|
this.btnDeleteCurrency.Size = new System.Drawing.Size(100, 31);
|
||||||
|
this.btnDeleteCurrency.TabIndex = 2;
|
||||||
|
this.btnDeleteCurrency.Text = "Delete Currency";
|
||||||
|
this.btnDeleteCurrency.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDeleteCurrency.Click += new System.EventHandler(this.btnDeleteCurrency_Click);
|
||||||
|
//
|
||||||
|
// frmMain
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(326, 410);
|
||||||
|
this.Controls.Add(this.groupBox3);
|
||||||
|
this.Controls.Add(this.groupBox2);
|
||||||
|
this.Controls.Add(this.groupBox1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "frmMain";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Currency Editor";
|
||||||
|
this.groupBox2.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox3.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.GroupBox groupBox2;
|
||||||
|
private System.Windows.Forms.PropertyGrid propertyGrid1;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.ListBox lstCurrencies;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox3;
|
||||||
|
private System.Windows.Forms.Button btnNewCurrency;
|
||||||
|
private System.Windows.Forms.Button btnSaveCurrency;
|
||||||
|
private System.Windows.Forms.Button btnDeleteCurrency;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
120
Mud Designer/Editors/CurrencyEditor.resx
Normal file
120
Mud Designer/Editors/CurrencyEditor.resx
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
155
Mud Designer/Editors/ProjectSettings.cs
Normal file
155
Mud Designer/Editors/ProjectSettings.cs
Normal file
|
@ -0,0 +1,155 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class ProjectSettings : Form
|
||||||
|
{
|
||||||
|
List<Zone> zones;
|
||||||
|
List<Room> rooms;
|
||||||
|
|
||||||
|
public ProjectSettings()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
zones = new List<Zone>();
|
||||||
|
rooms = new List<Room>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void frmMain_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//Get all of the realms currently created.
|
||||||
|
string[] files = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms), "*.realm");
|
||||||
|
|
||||||
|
//Aquire the Project settings and show them.
|
||||||
|
propertyGrid1.SelectedObject = Program.Project;
|
||||||
|
txtStory.Text = Program.Project.Story;
|
||||||
|
|
||||||
|
//Add each realm found into the combo box of available realms.
|
||||||
|
foreach (string realm in files)
|
||||||
|
{
|
||||||
|
//Instance a new realm
|
||||||
|
Realm newRealm = new Realm();
|
||||||
|
//De-serialize the current realm.
|
||||||
|
newRealm = (Realm)FileSystem.Load(realm, newRealm);
|
||||||
|
//Add it to the available realms combo box.
|
||||||
|
comRealms.Items.Add(newRealm.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
//If the Project already has a starting realm, then select it.
|
||||||
|
if (Program.Project.InitialLocation.Realm != null)
|
||||||
|
{
|
||||||
|
comRealms.SelectedIndex = comRealms.Items.IndexOf(Program.Project.InitialLocation.Realm.Name);
|
||||||
|
}
|
||||||
|
//If there is no starting realm, but a realm does exist, select the first one in the list.
|
||||||
|
else if (comRealms.Items.Count != 0)
|
||||||
|
{
|
||||||
|
comRealms.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
}//End frmMain_Load
|
||||||
|
|
||||||
|
private void comRealms_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
lstZones.Items.Clear();
|
||||||
|
|
||||||
|
//Check if we have any realms first.
|
||||||
|
if (comRealms.Items.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string[] files = System.IO.Directory.GetFiles(Application.StartupPath + @"\Data\Zones");
|
||||||
|
|
||||||
|
//Add each zone found into the list box.
|
||||||
|
foreach (string zone in files)
|
||||||
|
{
|
||||||
|
Zone newZone = new Zone();
|
||||||
|
//De-serialize the current zone.
|
||||||
|
newZone = (Zone)FileSystem.Load(zone, newZone);
|
||||||
|
//Add it to the available zones list box
|
||||||
|
lstZones.Items.Add(newZone.Name);
|
||||||
|
zones.Add(newZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if we have an existing realm that's set as our startup.
|
||||||
|
if (Program.Project.InitialLocation.Realm != null)
|
||||||
|
{
|
||||||
|
//Check if we have the Initial realm selected, if so we need to check the initial Zone as well
|
||||||
|
if (comRealms.SelectedItem.ToString() == Program.Project.InitialLocation.Realm.Name)
|
||||||
|
{
|
||||||
|
//We have an initial zone, so lets check it in the list box
|
||||||
|
if (Program.Project.InitialLocation.Zone != null)
|
||||||
|
{
|
||||||
|
if (lstZones.Items.Contains(Program.Project.InitialLocation.Zone.Name))
|
||||||
|
{
|
||||||
|
lstZones.SelectedIndex = lstZones.Items.IndexOf(Program.Project.InitialLocation.Zone.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}//End comRealms
|
||||||
|
|
||||||
|
private void lstZones_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string realm = comRealms.SelectedItem.ToString();
|
||||||
|
string zone = lstZones.SelectedItem.ToString();
|
||||||
|
|
||||||
|
lstRooms.Items.Clear();
|
||||||
|
|
||||||
|
//Check if we have any realms first.
|
||||||
|
if (comRealms.Items.Count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string[] files = System.IO.Directory.GetFiles(Application.StartupPath + @"\Data\Rooms");
|
||||||
|
|
||||||
|
//Add each room found into the list box.
|
||||||
|
foreach (string room in files)
|
||||||
|
{
|
||||||
|
Room newRoom = new Room();
|
||||||
|
//De-serialize the current Room.
|
||||||
|
newRoom = (Room)FileSystem.Load(room, newRoom);
|
||||||
|
//Add it to the available rooms list box
|
||||||
|
lstRooms.Items.Add(newRoom.Name);
|
||||||
|
rooms.Add(newRoom);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Now select the initial room if its listed.
|
||||||
|
string selectedRealm = comRealms.SelectedItem.ToString();
|
||||||
|
string selectedZone = lstZones.SelectedItem.ToString();
|
||||||
|
string initialRealm = Program.Project.InitialLocation.Realm.Name;
|
||||||
|
string initialZone = Program.Project.InitialLocation.Zone.Name;
|
||||||
|
|
||||||
|
//The realm and zone that matches the initial are selected, so lets select the initial room next.
|
||||||
|
if ((initialRealm == selectedRealm) && (initialZone == selectedZone))
|
||||||
|
{
|
||||||
|
foreach (Room room in rooms)
|
||||||
|
{
|
||||||
|
if (lstRooms.Items.Contains(room.Name))
|
||||||
|
lstRooms.SelectedIndex = lstRooms.Items.IndexOf(room.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtStory_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.Project.Story = txtStory.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProjectSettings_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
string filename = System.IO.Path.Combine(Engine.GetDataPath(Engine.SaveDataTypes.Root), "Project.xml");
|
||||||
|
FileSystem.Save(filename, Program.Project);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
215
Mud Designer/Editors/ProjectSettings.designer.cs
generated
Normal file
215
Mud Designer/Editors/ProjectSettings.designer.cs
generated
Normal file
|
@ -0,0 +1,215 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class ProjectSettings
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.propertyGrid1 = 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.lstRooms = new System.Windows.Forms.CheckedListBox();
|
||||||
|
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstZones = new System.Windows.Forms.CheckedListBox();
|
||||||
|
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.comRealms = new System.Windows.Forms.ComboBox();
|
||||||
|
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
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.propertyGrid1);
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
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;
|
||||||
|
//
|
||||||
|
// groupBox5
|
||||||
|
//
|
||||||
|
this.groupBox5.Controls.Add(this.txtStory);
|
||||||
|
this.groupBox5.Location = new System.Drawing.Point(3, 214);
|
||||||
|
this.groupBox5.Name = "groupBox5";
|
||||||
|
this.groupBox5.Size = new System.Drawing.Size(309, 173);
|
||||||
|
this.groupBox5.TabIndex = 1;
|
||||||
|
this.groupBox5.TabStop = false;
|
||||||
|
this.groupBox5.Text = "Project Story";
|
||||||
|
//
|
||||||
|
// txtStory
|
||||||
|
//
|
||||||
|
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.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";
|
||||||
|
//
|
||||||
|
// 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, 154);
|
||||||
|
this.lstRooms.TabIndex = 1;
|
||||||
|
this.lstRooms.ThreeDCheckBoxes = true;
|
||||||
|
//
|
||||||
|
// 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";
|
||||||
|
//
|
||||||
|
// 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, 109);
|
||||||
|
this.lstZones.TabIndex = 0;
|
||||||
|
this.lstZones.ThreeDCheckBoxes = true;
|
||||||
|
this.lstZones.SelectedIndexChanged += new System.EventHandler(this.lstZones_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// 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);
|
||||||
|
//
|
||||||
|
// ProjectSettings
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(573, 390);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "ProjectSettings";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Mud Designer: Project Manager";
|
||||||
|
this.Load += new System.EventHandler(this.frmMain_Load);
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ProjectSettings_FormClosing);
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#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.CheckedListBox lstRooms;
|
||||||
|
private System.Windows.Forms.CheckedListBox lstZones;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox5;
|
||||||
|
private System.Windows.Forms.RichTextBox txtStory;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
123
Mud Designer/Editors/ProjectSettings.resx
Normal file
123
Mud Designer/Editors/ProjectSettings.resx
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="splitContainer1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
236
Mud Designer/Editors/RealmExplorer.cs
Normal file
236
Mud Designer/Editors/RealmExplorer.cs
Normal file
|
@ -0,0 +1,236 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ManagedScripting;
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class RealmExplorer : Form
|
||||||
|
{
|
||||||
|
Zone _Zone;
|
||||||
|
Realm _CurrentRealm;
|
||||||
|
List<Zone> _AvailableZones;
|
||||||
|
ScriptingEngine _ScriptEngine;
|
||||||
|
|
||||||
|
public RealmExplorer()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_Zone = new Zone();
|
||||||
|
_CurrentRealm = new Realm();
|
||||||
|
_AvailableZones = new List<Zone>();
|
||||||
|
_ScriptEngine = new ScriptingEngine();
|
||||||
|
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||||
|
_ScriptEngine.KeepTempFiles = false;
|
||||||
|
|
||||||
|
BuildZoneLists();
|
||||||
|
|
||||||
|
SetupScript();
|
||||||
|
|
||||||
|
propertyRealm.SelectedObject = _CurrentRealm;
|
||||||
|
|
||||||
|
string[] existingRealms = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms));
|
||||||
|
foreach (string realm in existingRealms)
|
||||||
|
lstRealms.Items.Add(System.IO.Path.GetFileNameWithoutExtension(realm));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BuildZoneLists()
|
||||||
|
{
|
||||||
|
string[] zones = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Zones), "*.zone");
|
||||||
|
bool available = true;
|
||||||
|
lstAvailableZones.Items.Clear();
|
||||||
|
lstZonesInRealm.Items.Clear();
|
||||||
|
|
||||||
|
foreach (string zone in zones)
|
||||||
|
{
|
||||||
|
string[] realms = System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Realms), "*.realm");
|
||||||
|
|
||||||
|
foreach (string realm in realms)
|
||||||
|
{
|
||||||
|
Realm r = new Realm();
|
||||||
|
r = (Realm)ManagedScripting.XmlSerialization.Load(realm, r);
|
||||||
|
|
||||||
|
foreach (Zone z in r.Zones)
|
||||||
|
{
|
||||||
|
if (z.Name == System.IO.Path.GetFileNameWithoutExtension(zone))
|
||||||
|
{
|
||||||
|
available = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!available)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!available)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lstAvailableZones.Items.Add(System.IO.Path.GetFileNameWithoutExtension(zone));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupScript()
|
||||||
|
{
|
||||||
|
//Check if the realm script is empty. If so then generate a standard script for it.
|
||||||
|
if (String.IsNullOrEmpty(_CurrentRealm.Script))
|
||||||
|
{
|
||||||
|
//Instance a new method helper class
|
||||||
|
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
string script = "";
|
||||||
|
//Setup our method. All objects inheriting from BaseObject will have the standard
|
||||||
|
//methods created for them.
|
||||||
|
string[] names = new string[] { "OnCreate", "OnDestroy", "OnEnter", "OnExit" };
|
||||||
|
foreach (string name in names)
|
||||||
|
{
|
||||||
|
method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
method.Name = name;
|
||||||
|
method.ReturnType = "void";
|
||||||
|
method.IsOverride = true;
|
||||||
|
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||||
|
method.Code = new string[] { "base." + method.Name + "();" };
|
||||||
|
script = script.Insert(_CurrentRealm.Script.Length, method.Create() + "\n");
|
||||||
|
}
|
||||||
|
_CurrentRealm.Script = script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnNewRealm_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_Zone = new Zone();
|
||||||
|
_CurrentRealm = new Realm();
|
||||||
|
SetupScript();
|
||||||
|
|
||||||
|
propertyRealm.SelectedObject = _CurrentRealm;
|
||||||
|
lstZonesInRealm.Items.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveRealm_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||||
|
string filename = System.IO.Path.Combine(path, _CurrentRealm.Name + ".realm");
|
||||||
|
if (System.IO.File.Exists(filename))
|
||||||
|
{
|
||||||
|
DialogResult result = MessageBox.Show("File exists!\nOverwrite?", "Realm Explorer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||||
|
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem.Save(filename, _CurrentRealm);
|
||||||
|
|
||||||
|
if (!lstRealms.Items.Contains(_CurrentRealm.Name))
|
||||||
|
lstRealms.Items.Add(_CurrentRealm.Name);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void lstRealms_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lstRealms.SelectedIndex == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||||
|
string filename = System.IO.Path.Combine(path, lstRealms.SelectedItem.ToString() + ".realm");
|
||||||
|
_CurrentRealm = (Realm)FileSystem.Load(filename, _CurrentRealm);
|
||||||
|
|
||||||
|
propertyRealm.SelectedObject = _CurrentRealm;
|
||||||
|
lstZonesInRealm.Items.Clear();
|
||||||
|
|
||||||
|
foreach (string file in System.IO.Directory.GetFiles(Engine.GetDataPath(Engine.SaveDataTypes.Zones), "*.zone"))
|
||||||
|
{
|
||||||
|
Zone zone = new Zone();
|
||||||
|
zone = (Zone)FileSystem.Load(file, zone);
|
||||||
|
|
||||||
|
if (zone.Realm == _CurrentRealm.Name)
|
||||||
|
lstZonesInRealm.Items.Add(zone.Name);
|
||||||
|
else if (String.IsNullOrEmpty(zone.Realm))
|
||||||
|
{
|
||||||
|
lstAvailableZones.Items.Add(zone.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnDeleteRealm_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lstRealms.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Select a Realm to delete first!", "Realm Exporer", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DialogResult result = MessageBox.Show("Are you sure you want to delete the " + lstRealms.SelectedItem.ToString() + " Realm?",
|
||||||
|
"Realm Explorer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||||
|
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string path = Engine.GetDataPath(Engine.SaveDataTypes.Realms);
|
||||||
|
string filename = System.IO.Path.Combine(path, lstRealms.SelectedItem.ToString() + ".realm");
|
||||||
|
System.IO.File.Delete(filename);
|
||||||
|
lstRealms.Items.Remove(lstRealms.SelectedItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (tabControl1.SelectedTab.Text == "Script")
|
||||||
|
{
|
||||||
|
txtScript.Text = _CurrentRealm.Script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnValidateScript_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||||
|
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||||
|
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||||
|
+ "{\n"
|
||||||
|
+ " public class " + _CurrentRealm.Name.Replace(" ", "") + " : Realm\n"
|
||||||
|
+ " {\n"
|
||||||
|
+ " " + txtScript.Text + "\n"
|
||||||
|
+ " }\n"
|
||||||
|
+ "}\n";
|
||||||
|
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnBuildZone_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ZoneBuilder form = new ZoneBuilder();
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnPlaceZone_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lstAvailableZones.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Please select a Zone to add!", "Realm Explorer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string path = Engine.GetDataPath(Engine.SaveDataTypes.Zones);
|
||||||
|
string filename = System.IO.Path.Combine(path, lstAvailableZones.SelectedItem.ToString() + ".zone");
|
||||||
|
Zone zone = new Zone();
|
||||||
|
zone = (Zone)FileSystem.Load(filename, zone);
|
||||||
|
zone.Realm = _CurrentRealm.Name;
|
||||||
|
FileSystem.Save(filename, zone);
|
||||||
|
|
||||||
|
_CurrentRealm.Zones.Add(zone);
|
||||||
|
lstZonesInRealm.Items.Add(zone.Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
370
Mud Designer/Editors/RealmExplorer.designer.cs
generated
Normal file
370
Mud Designer/Editors/RealmExplorer.designer.cs
generated
Normal file
|
@ -0,0 +1,370 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class RealmExplorer
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
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.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnRemoveZone = new System.Windows.Forms.Button();
|
||||||
|
this.btnPlaceZone = new System.Windows.Forms.Button();
|
||||||
|
this.btnBuildZone = new System.Windows.Forms.Button();
|
||||||
|
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstZonesInRealm = new System.Windows.Forms.ListBox();
|
||||||
|
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstAvailableZones = new System.Windows.Forms.ListBox();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabOptions = new System.Windows.Forms.TabPage();
|
||||||
|
this.btnValidateScript = new System.Windows.Forms.Button();
|
||||||
|
this.btnClose = 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.txtScript = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.splitContainer2.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer2.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer2.SuspendLayout();
|
||||||
|
this.groupBox4.SuspendLayout();
|
||||||
|
this.groupBox3.SuspendLayout();
|
||||||
|
this.groupBox2.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.tabControl1.SuspendLayout();
|
||||||
|
this.tabOptions.SuspendLayout();
|
||||||
|
this.tabScript.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// 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.Name = "splitContainer1";
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox4);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox3);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.groupBox1);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(465, 488);
|
||||||
|
this.splitContainer1.SplitterDistance = 193;
|
||||||
|
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(193, 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(193, 212);
|
||||||
|
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(193, 264);
|
||||||
|
this.propertyRealm.TabIndex = 0;
|
||||||
|
this.propertyRealm.ToolbarVisible = false;
|
||||||
|
//
|
||||||
|
// groupBox4
|
||||||
|
//
|
||||||
|
this.groupBox4.Controls.Add(this.btnRemoveZone);
|
||||||
|
this.groupBox4.Controls.Add(this.btnPlaceZone);
|
||||||
|
this.groupBox4.Controls.Add(this.btnBuildZone);
|
||||||
|
this.groupBox4.Location = new System.Drawing.Point(2, 256);
|
||||||
|
this.groupBox4.Name = "groupBox4";
|
||||||
|
this.groupBox4.Size = new System.Drawing.Size(260, 88);
|
||||||
|
this.groupBox4.TabIndex = 3;
|
||||||
|
this.groupBox4.TabStop = false;
|
||||||
|
this.groupBox4.Text = "Realm Zone Setup";
|
||||||
|
//
|
||||||
|
// btnRemoveZone
|
||||||
|
//
|
||||||
|
this.btnRemoveZone.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.btnRemoveZone.Location = new System.Drawing.Point(3, 62);
|
||||||
|
this.btnRemoveZone.Name = "btnRemoveZone";
|
||||||
|
this.btnRemoveZone.Size = new System.Drawing.Size(254, 23);
|
||||||
|
this.btnRemoveZone.TabIndex = 3;
|
||||||
|
this.btnRemoveZone.Text = "Remove Zone From Realm";
|
||||||
|
this.btnRemoveZone.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// btnPlaceZone
|
||||||
|
//
|
||||||
|
this.btnPlaceZone.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.btnPlaceZone.Location = new System.Drawing.Point(3, 39);
|
||||||
|
this.btnPlaceZone.Name = "btnPlaceZone";
|
||||||
|
this.btnPlaceZone.Size = new System.Drawing.Size(254, 23);
|
||||||
|
this.btnPlaceZone.TabIndex = 2;
|
||||||
|
this.btnPlaceZone.Text = "Place Zone In Realm";
|
||||||
|
this.btnPlaceZone.UseVisualStyleBackColor = true;
|
||||||
|
this.btnPlaceZone.Click += new System.EventHandler(this.btnPlaceZone_Click);
|
||||||
|
//
|
||||||
|
// 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(254, 23);
|
||||||
|
this.btnBuildZone.TabIndex = 1;
|
||||||
|
this.btnBuildZone.Text = "Build A Zone";
|
||||||
|
this.btnBuildZone.UseVisualStyleBackColor = true;
|
||||||
|
this.btnBuildZone.Click += new System.EventHandler(this.btnBuildZone_Click);
|
||||||
|
//
|
||||||
|
// groupBox3
|
||||||
|
//
|
||||||
|
this.groupBox3.Controls.Add(this.lstZonesInRealm);
|
||||||
|
this.groupBox3.Location = new System.Drawing.Point(2, 350);
|
||||||
|
this.groupBox3.Name = "groupBox3";
|
||||||
|
this.groupBox3.Size = new System.Drawing.Size(260, 135);
|
||||||
|
this.groupBox3.TabIndex = 2;
|
||||||
|
this.groupBox3.TabStop = false;
|
||||||
|
this.groupBox3.Text = "Zones contained within 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(254, 108);
|
||||||
|
this.lstZonesInRealm.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
this.groupBox2.Controls.Add(this.lstAvailableZones);
|
||||||
|
this.groupBox2.Location = new System.Drawing.Point(2, 148);
|
||||||
|
this.groupBox2.Name = "groupBox2";
|
||||||
|
this.groupBox2.Size = new System.Drawing.Size(260, 102);
|
||||||
|
this.groupBox2.TabIndex = 1;
|
||||||
|
this.groupBox2.TabStop = false;
|
||||||
|
this.groupBox2.Text = "Available Zones";
|
||||||
|
//
|
||||||
|
// lstAvailableZones
|
||||||
|
//
|
||||||
|
this.lstAvailableZones.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lstAvailableZones.FormattingEnabled = true;
|
||||||
|
this.lstAvailableZones.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.lstAvailableZones.Name = "lstAvailableZones";
|
||||||
|
this.lstAvailableZones.Size = new System.Drawing.Size(254, 82);
|
||||||
|
this.lstAvailableZones.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// 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(265, 142);
|
||||||
|
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(259, 123);
|
||||||
|
this.tabControl1.TabIndex = 0;
|
||||||
|
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// tabOptions
|
||||||
|
//
|
||||||
|
this.tabOptions.Controls.Add(this.btnValidateScript);
|
||||||
|
this.tabOptions.Controls.Add(this.btnClose);
|
||||||
|
this.tabOptions.Controls.Add(this.btnSaveRealm);
|
||||||
|
this.tabOptions.Controls.Add(this.btnDeleteRealm);
|
||||||
|
this.tabOptions.Controls.Add(this.btnNewRealm);
|
||||||
|
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(251, 97);
|
||||||
|
this.tabOptions.TabIndex = 0;
|
||||||
|
this.tabOptions.Text = "Explorer Options";
|
||||||
|
this.tabOptions.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// btnValidateScript
|
||||||
|
//
|
||||||
|
this.btnValidateScript.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.btnValidateScript.Location = new System.Drawing.Point(3, 71);
|
||||||
|
this.btnValidateScript.Name = "btnValidateScript";
|
||||||
|
this.btnValidateScript.Size = new System.Drawing.Size(245, 23);
|
||||||
|
this.btnValidateScript.TabIndex = 8;
|
||||||
|
this.btnValidateScript.Text = "Validate Script";
|
||||||
|
this.btnValidateScript.UseVisualStyleBackColor = true;
|
||||||
|
this.btnValidateScript.Click += new System.EventHandler(this.btnValidateScript_Click);
|
||||||
|
//
|
||||||
|
// btnClose
|
||||||
|
//
|
||||||
|
this.btnClose.Location = new System.Drawing.Point(139, 35);
|
||||||
|
this.btnClose.Name = "btnClose";
|
||||||
|
this.btnClose.Size = new System.Drawing.Size(109, 23);
|
||||||
|
this.btnClose.TabIndex = 7;
|
||||||
|
this.btnClose.Text = "Close Explorer";
|
||||||
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
|
//
|
||||||
|
// btnSaveRealm
|
||||||
|
//
|
||||||
|
this.btnSaveRealm.Location = new System.Drawing.Point(139, 6);
|
||||||
|
this.btnSaveRealm.Name = "btnSaveRealm";
|
||||||
|
this.btnSaveRealm.Size = new System.Drawing.Size(109, 23);
|
||||||
|
this.btnSaveRealm.TabIndex = 6;
|
||||||
|
this.btnSaveRealm.Text = "Save Realm";
|
||||||
|
this.btnSaveRealm.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveRealm.Click += new System.EventHandler(this.btnSaveRealm_Click);
|
||||||
|
//
|
||||||
|
// btnDeleteRealm
|
||||||
|
//
|
||||||
|
this.btnDeleteRealm.Location = new System.Drawing.Point(3, 35);
|
||||||
|
this.btnDeleteRealm.Name = "btnDeleteRealm";
|
||||||
|
this.btnDeleteRealm.Size = new System.Drawing.Size(114, 23);
|
||||||
|
this.btnDeleteRealm.TabIndex = 5;
|
||||||
|
this.btnDeleteRealm.Text = "Delete Realm";
|
||||||
|
this.btnDeleteRealm.UseVisualStyleBackColor = true;
|
||||||
|
this.btnDeleteRealm.Click += new System.EventHandler(this.btnDeleteRealm_Click);
|
||||||
|
//
|
||||||
|
// btnNewRealm
|
||||||
|
//
|
||||||
|
this.btnNewRealm.Location = new System.Drawing.Point(3, 6);
|
||||||
|
this.btnNewRealm.Name = "btnNewRealm";
|
||||||
|
this.btnNewRealm.Size = new System.Drawing.Size(114, 23);
|
||||||
|
this.btnNewRealm.TabIndex = 4;
|
||||||
|
this.btnNewRealm.Text = "New Realm";
|
||||||
|
this.btnNewRealm.UseVisualStyleBackColor = true;
|
||||||
|
this.btnNewRealm.Click += new System.EventHandler(this.btnNewRealm_Click);
|
||||||
|
//
|
||||||
|
// 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(251, 97);
|
||||||
|
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, 3);
|
||||||
|
this.txtScript.Name = "txtScript";
|
||||||
|
this.txtScript.Size = new System.Drawing.Size(245, 91);
|
||||||
|
this.txtScript.TabIndex = 0;
|
||||||
|
this.txtScript.Text = "";
|
||||||
|
//
|
||||||
|
// RealmExplorer
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(465, 488);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.Name = "RealmExplorer";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Realm Explorer";
|
||||||
|
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.groupBox4.ResumeLayout(false);
|
||||||
|
this.groupBox3.ResumeLayout(false);
|
||||||
|
this.groupBox2.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.tabControl1.ResumeLayout(false);
|
||||||
|
this.tabOptions.ResumeLayout(false);
|
||||||
|
this.tabScript.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.GroupBox groupBox2;
|
||||||
|
private System.Windows.Forms.ListBox lstAvailableZones;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox3;
|
||||||
|
private System.Windows.Forms.ListBox lstZonesInRealm;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox4;
|
||||||
|
private System.Windows.Forms.Button btnPlaceZone;
|
||||||
|
private System.Windows.Forms.Button btnBuildZone;
|
||||||
|
private System.Windows.Forms.TabControl tabControl1;
|
||||||
|
private System.Windows.Forms.TabPage tabOptions;
|
||||||
|
private System.Windows.Forms.Button btnClose;
|
||||||
|
private System.Windows.Forms.Button btnSaveRealm;
|
||||||
|
private System.Windows.Forms.Button btnDeleteRealm;
|
||||||
|
private System.Windows.Forms.Button btnNewRealm;
|
||||||
|
private System.Windows.Forms.TabPage tabScript;
|
||||||
|
private System.Windows.Forms.RichTextBox txtScript;
|
||||||
|
private System.Windows.Forms.Button btnValidateScript;
|
||||||
|
private System.Windows.Forms.Button btnRemoveZone;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
120
Mud Designer/Editors/RealmExplorer.resx
Normal file
120
Mud Designer/Editors/RealmExplorer.resx
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
371
Mud Designer/Editors/RoomDesigner.cs
Normal file
371
Mud Designer/Editors/RoomDesigner.cs
Normal file
|
@ -0,0 +1,371 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class RoomDesigner : Form
|
||||||
|
{
|
||||||
|
//Current _CurrentRoom
|
||||||
|
Room _CurrentRoom;
|
||||||
|
|
||||||
|
//Doorway currently loaded.
|
||||||
|
Door _CurrentDoor;
|
||||||
|
|
||||||
|
//Scripting engine and it's components.
|
||||||
|
ManagedScripting.ScriptingEngine _ScriptEngine;
|
||||||
|
|
||||||
|
//Collection of plugins from within the 'plugins' folder
|
||||||
|
List<System.Reflection.Assembly> _Plugins;
|
||||||
|
|
||||||
|
public RoomDesigner(params object[] parameters)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
SetupEditor(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupEditor(params object[] parameters)
|
||||||
|
{
|
||||||
|
//Initialize the Room & Doorway
|
||||||
|
_CurrentRoom = new Room();
|
||||||
|
_CurrentDoor = new Door(AvailableTravelDirections.None);
|
||||||
|
|
||||||
|
//This instances a copy of AvailableTravelDirections which is a list of
|
||||||
|
//currently available directions users can travel within rooms.
|
||||||
|
//Instead of updating the editor each time a new travel direction is implemented,
|
||||||
|
//we simply build an array that contains each travel direction currently available
|
||||||
|
//within the engine by getting each element from the AvailableTravelDirections enum
|
||||||
|
BuildDoorwayList();
|
||||||
|
|
||||||
|
//Load all of our plugin .dll files. This is the only directory not generated by
|
||||||
|
//the engine, developers will need to manually create the folder if they want to
|
||||||
|
//create plugins
|
||||||
|
LoadPlugins();
|
||||||
|
|
||||||
|
//Instance the scripting engine and set it up.
|
||||||
|
_ScriptEngine = new ManagedScripting.ScriptingEngine();
|
||||||
|
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||||
|
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||||
|
_ScriptEngine.KeepTempFiles = false;
|
||||||
|
|
||||||
|
//Get the current rooms scripts.
|
||||||
|
//TODO: Add Doorway script support
|
||||||
|
//SetupRoomScript();
|
||||||
|
|
||||||
|
if (parameters.Length != 0)
|
||||||
|
{
|
||||||
|
foreach (object argument in parameters)
|
||||||
|
{
|
||||||
|
if (argument.ToString().ToLower().StartsWith("room="))
|
||||||
|
{
|
||||||
|
string roomPath = Engine.GetDataPath(Engine.SaveDataTypes.Rooms);
|
||||||
|
string room = argument.ToString().Substring("room=".Length);
|
||||||
|
string filename = System.IO.Path.Combine(roomPath, room.ToString());
|
||||||
|
|
||||||
|
//Room to load should always be the first arg.
|
||||||
|
if (System.IO.File.Exists(filename))
|
||||||
|
{
|
||||||
|
_CurrentRoom = (Room)FileSystem.Load(filename, _CurrentRoom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Show the user(s) the rooms properties
|
||||||
|
propertyRoom.SelectedObject = _CurrentRoom;
|
||||||
|
txtScript.Text = _CurrentRoom.Script;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupRoomScript()
|
||||||
|
{
|
||||||
|
//Check if the rooms script is empty. If so then generate a standard script for it.
|
||||||
|
if (String.IsNullOrEmpty(_CurrentRoom.Script))
|
||||||
|
{
|
||||||
|
//Instance a new method helper class
|
||||||
|
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
string script = "";
|
||||||
|
//Setup our method. All objects inheriting from BaseObject will have the standard
|
||||||
|
//methods created for them.
|
||||||
|
string[] names = new string[] { "OnCreate", "OnDestroy", "OnEnter", "OnExit" };
|
||||||
|
foreach (string name in names)
|
||||||
|
{
|
||||||
|
method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
method.Name = name;
|
||||||
|
method.ReturnType = "void";
|
||||||
|
method.IsOverride = true;
|
||||||
|
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||||
|
method.Code = new string[] { "base." + method.Name + "();" };
|
||||||
|
script = script.Insert(_CurrentRoom.Script.Length, method.Create() + "\n");
|
||||||
|
}
|
||||||
|
_CurrentRoom.Script = script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BuildDoorwayList()
|
||||||
|
{
|
||||||
|
AvailableTravelDirections direction = new AvailableTravelDirections();
|
||||||
|
|
||||||
|
//Build an array of travel directions currently implemented
|
||||||
|
Array Values = System.Enum.GetValues(direction.GetType());
|
||||||
|
|
||||||
|
//Loop through each travel direction within the array and add it
|
||||||
|
//to the lstDirections listbox.
|
||||||
|
foreach (int Value in Values)
|
||||||
|
{
|
||||||
|
string Display = Enum.GetName(direction.GetType(), Value);
|
||||||
|
//The array contains a 'None' direction. As the editor will allow for
|
||||||
|
//installing and uninstalling doorways, we don't need to show a 'None' direction
|
||||||
|
//in the listbox.
|
||||||
|
if (!Display.Equals("None"))
|
||||||
|
this.lstDirections.Items.Add(Display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadPlugins()
|
||||||
|
{
|
||||||
|
string pluginPath = System.IO.Path.Combine(Application.StartupPath, "Plugins");
|
||||||
|
_Plugins = new List<System.Reflection.Assembly>();
|
||||||
|
|
||||||
|
//Check if the plugin path exists.
|
||||||
|
if (!System.IO.Directory.Exists(pluginPath))
|
||||||
|
return;
|
||||||
|
|
||||||
|
//Now loop through every .dll file in the plugins directory and load it into memory
|
||||||
|
//A copy is stored within a collection for use later if needed.
|
||||||
|
foreach (string assembly in System.IO.Directory.GetFiles(pluginPath, "*.dll"))
|
||||||
|
{
|
||||||
|
_Plugins.Add(System.Reflection.Assembly.LoadFile(assembly));
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: Look for ways to allow Types to inherit from a Windows Control, and add each
|
||||||
|
//control to a new tab or menu item, allowing for editor plugins as well.
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Closes the editor.
|
||||||
|
/// TODO: Serialize the Room out to file.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void btnCloseEditor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Change the currently selected direction, allowing users to uninstall or install
|
||||||
|
/// a doorway, and display the selected doorways properties for editing.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void lstDirections_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//Used to indicate that the direction the user selected exists,
|
||||||
|
//and was found for editing
|
||||||
|
bool IsFound = false;
|
||||||
|
|
||||||
|
//Loop through each doorway installed within the _CurrentRoom and see if the user has
|
||||||
|
//selected a direction that belongs to a _CurrentDoor already created. If a _CurrentDoor with
|
||||||
|
//the selected direction is found, we display it's properties for editing instead
|
||||||
|
//of creating a new _CurrentDoor and overwriting the previously created doorway.
|
||||||
|
foreach (Door newDoor in _CurrentRoom.InstalledDoors)
|
||||||
|
{
|
||||||
|
//Check if the current _CurrentDoor in the loop matches the currently selected
|
||||||
|
//travel direction the user has selected in the listbox.
|
||||||
|
if (newDoor.TravelDirection.ToString() == lstDirections.SelectedItem.ToString())
|
||||||
|
{
|
||||||
|
//The travel directions match, let's set the current _CurrentDoor in the loop as our
|
||||||
|
//new selected doorway so that the user can edit it.
|
||||||
|
_CurrentDoor = newDoor;
|
||||||
|
|
||||||
|
//Indicates that we found a matching doorway and have set it up for
|
||||||
|
//editing within the propertygrid
|
||||||
|
IsFound = true;
|
||||||
|
|
||||||
|
//Exit the loop
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//There isn't a _CurrentDoor installed into the _CurrentRoom yet with a travel direction
|
||||||
|
//matching that of the users currently selected travel direction within the listbox.
|
||||||
|
//so we instance a new _CurrentDoor
|
||||||
|
if (!IsFound)
|
||||||
|
{
|
||||||
|
AvailableTravelDirections direction = GetDirection(lstDirections.SelectedItem.ToString());
|
||||||
|
_CurrentDoor = new Door(direction);
|
||||||
|
}
|
||||||
|
//Display the properties for users to edit. This could be a pre-existing doorway
|
||||||
|
//found within our loop, or a new doorway.
|
||||||
|
propertyDoor.SelectedObject = _CurrentDoor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Modified values within the doorway get stored within the currentDoor Field.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="s"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void propertyDoor_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||||
|
{
|
||||||
|
//Check if we are installing the door into the room or
|
||||||
|
//uninstalling it from the current room.
|
||||||
|
switch (_CurrentDoor.DoorState)
|
||||||
|
{
|
||||||
|
case Door.AvailableDoorStates.Installed:
|
||||||
|
InstallDoor();
|
||||||
|
break;
|
||||||
|
case Door.AvailableDoorStates.Uninstalled:
|
||||||
|
UninstallDoor();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts a string into an AvailableTravelDirections enum equivilant if it
|
||||||
|
/// exists within the enum list.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Direction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private AvailableTravelDirections GetDirection(string Direction)
|
||||||
|
{
|
||||||
|
foreach (AvailableTravelDirections value in Enum.GetValues(typeof(AvailableTravelDirections)))
|
||||||
|
{
|
||||||
|
string name = value.ToString();
|
||||||
|
|
||||||
|
if (name == Direction)
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AvailableTravelDirections.None;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Installs the _CurrentDoor into the _CurrentRoom's collection of doorways
|
||||||
|
/// </summary>
|
||||||
|
private void InstallDoor()
|
||||||
|
{
|
||||||
|
//Indicates if we found a door already installed within the room
|
||||||
|
//matching the selected travel direction.
|
||||||
|
bool IsInstalled = false;
|
||||||
|
|
||||||
|
//Incase there are no existing doors, the foreach loop gets skipped.
|
||||||
|
if (_CurrentRoom.InstalledDoors.Count == 0)
|
||||||
|
{
|
||||||
|
//Add the new door to the room
|
||||||
|
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Loop through all of the installed doors within this room and
|
||||||
|
//check to see if we have a doorway with the same travel direction
|
||||||
|
//that the user has selected within the list box. If so then we
|
||||||
|
//need to prompt the user to ensure it's ok to overwrite the previous
|
||||||
|
//door with a new door.
|
||||||
|
foreach (Door newDoor in _CurrentRoom.InstalledDoors)
|
||||||
|
{
|
||||||
|
if (newDoor.TravelDirection == _CurrentDoor.TravelDirection)
|
||||||
|
{
|
||||||
|
_CurrentRoom.InstalledDoors.Remove(newDoor);
|
||||||
|
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||||
|
IsInstalled = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsInstalled)
|
||||||
|
_CurrentRoom.InstalledDoors.Add(_CurrentDoor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Uninstalls the doorway from the room.
|
||||||
|
/// </summary>
|
||||||
|
private void UninstallDoor()
|
||||||
|
{
|
||||||
|
foreach (Door door in _CurrentRoom.InstalledDoors)
|
||||||
|
{
|
||||||
|
if (door.TravelDirection == _CurrentDoor.TravelDirection)
|
||||||
|
{
|
||||||
|
_CurrentRoom.InstalledDoors.Remove(door);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Resets the room.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void btnNewRoom_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult result = MessageBox.Show("Are you sure you want to create a new room?", "Room Designer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_CurrentRoom = new Room();
|
||||||
|
_CurrentDoor = new Door(AvailableTravelDirections.None);
|
||||||
|
SetupRoomScript();
|
||||||
|
|
||||||
|
propertyDoor.SelectedObject = null;
|
||||||
|
propertyRoom.SelectedObject = _CurrentRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveRoom_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string savePath = Engine.GetDataPath(Engine.SaveDataTypes.Rooms);
|
||||||
|
string filePath = System.IO.Path.Combine(savePath, _CurrentRoom.Name + ".room");
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(filePath))
|
||||||
|
{
|
||||||
|
DialogResult result = MessageBox.Show("File exists! Overwrite?", "Room Designer", MessageBoxButtons.YesNo);
|
||||||
|
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
FileSystem.Save(filePath, _CurrentRoom);
|
||||||
|
MessageBox.Show("Saved.", "Room Designer");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (tabObjects.SelectedTab.Text == "Script")
|
||||||
|
{
|
||||||
|
txtScript.Text = _CurrentRoom.Script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCheckScript_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||||
|
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||||
|
|
||||||
|
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||||
|
+ "{\n"
|
||||||
|
+ " public class " + _CurrentRoom.Name.Replace(" ", "") + " : Room\n"
|
||||||
|
+ " {\n"
|
||||||
|
+ " " + txtScript.Text + "\n"
|
||||||
|
+ " }\n"
|
||||||
|
+ "}\n";
|
||||||
|
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void txtScript_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_CurrentRoom.Script = txtScript.Text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
356
Mud Designer/Editors/RoomDesigner.designer.cs
generated
Normal file
356
Mud Designer/Editors/RoomDesigner.designer.cs
generated
Normal file
|
@ -0,0 +1,356 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class RoomDesigner
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.containerMain = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.containerSidebar = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.btnCloseEditor = new System.Windows.Forms.Button();
|
||||||
|
this.btnCheckScript = new System.Windows.Forms.Button();
|
||||||
|
this.btnSaveRoom = new System.Windows.Forms.Button();
|
||||||
|
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.propertyRoom = new System.Windows.Forms.PropertyGrid();
|
||||||
|
this.containerDesigner = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.tabObjects = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabScript = new System.Windows.Forms.TabPage();
|
||||||
|
this.txtScript = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.groupBox5 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.groupBox7 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.groupBox10 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.propertyDoor = new System.Windows.Forms.PropertyGrid();
|
||||||
|
this.groupBox6 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstDirections = new System.Windows.Forms.ListBox();
|
||||||
|
this.containerMain.Panel1.SuspendLayout();
|
||||||
|
this.containerMain.Panel2.SuspendLayout();
|
||||||
|
this.containerMain.SuspendLayout();
|
||||||
|
this.containerSidebar.Panel1.SuspendLayout();
|
||||||
|
this.containerSidebar.Panel2.SuspendLayout();
|
||||||
|
this.containerSidebar.SuspendLayout();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.groupBox2.SuspendLayout();
|
||||||
|
this.containerDesigner.Panel1.SuspendLayout();
|
||||||
|
this.containerDesigner.Panel2.SuspendLayout();
|
||||||
|
this.containerDesigner.SuspendLayout();
|
||||||
|
this.groupBox4.SuspendLayout();
|
||||||
|
this.tabObjects.SuspendLayout();
|
||||||
|
this.tabScript.SuspendLayout();
|
||||||
|
this.groupBox5.SuspendLayout();
|
||||||
|
this.groupBox7.SuspendLayout();
|
||||||
|
this.groupBox10.SuspendLayout();
|
||||||
|
this.groupBox6.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// containerMain
|
||||||
|
//
|
||||||
|
this.containerMain.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.containerMain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.containerMain.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.containerMain.Name = "containerMain";
|
||||||
|
//
|
||||||
|
// containerMain.Panel1
|
||||||
|
//
|
||||||
|
this.containerMain.Panel1.Controls.Add(this.containerSidebar);
|
||||||
|
//
|
||||||
|
// containerMain.Panel2
|
||||||
|
//
|
||||||
|
this.containerMain.Panel2.Controls.Add(this.containerDesigner);
|
||||||
|
this.containerMain.Size = new System.Drawing.Size(792, 564);
|
||||||
|
this.containerMain.SplitterDistance = 211;
|
||||||
|
this.containerMain.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// containerSidebar
|
||||||
|
//
|
||||||
|
this.containerSidebar.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.containerSidebar.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.containerSidebar.Name = "containerSidebar";
|
||||||
|
this.containerSidebar.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// containerSidebar.Panel1
|
||||||
|
//
|
||||||
|
this.containerSidebar.Panel1.Controls.Add(this.groupBox1);
|
||||||
|
//
|
||||||
|
// containerSidebar.Panel2
|
||||||
|
//
|
||||||
|
this.containerSidebar.Panel2.Controls.Add(this.groupBox2);
|
||||||
|
this.containerSidebar.Size = new System.Drawing.Size(209, 562);
|
||||||
|
this.containerSidebar.SplitterDistance = 88;
|
||||||
|
this.containerSidebar.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.btnCloseEditor);
|
||||||
|
this.groupBox1.Controls.Add(this.btnCheckScript);
|
||||||
|
this.groupBox1.Controls.Add(this.btnSaveRoom);
|
||||||
|
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(209, 88);
|
||||||
|
this.groupBox1.TabIndex = 4;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "Room Options";
|
||||||
|
//
|
||||||
|
// btnCloseEditor
|
||||||
|
//
|
||||||
|
this.btnCloseEditor.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.btnCloseEditor.Location = new System.Drawing.Point(3, 62);
|
||||||
|
this.btnCloseEditor.Name = "btnCloseEditor";
|
||||||
|
this.btnCloseEditor.Size = new System.Drawing.Size(203, 23);
|
||||||
|
this.btnCloseEditor.TabIndex = 10;
|
||||||
|
this.btnCloseEditor.Text = "Close Editor";
|
||||||
|
this.btnCloseEditor.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCloseEditor.Click += new System.EventHandler(this.btnCloseEditor_Click);
|
||||||
|
//
|
||||||
|
// btnCheckScript
|
||||||
|
//
|
||||||
|
this.btnCheckScript.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.btnCheckScript.Location = new System.Drawing.Point(3, 39);
|
||||||
|
this.btnCheckScript.Name = "btnCheckScript";
|
||||||
|
this.btnCheckScript.Size = new System.Drawing.Size(203, 23);
|
||||||
|
this.btnCheckScript.TabIndex = 9;
|
||||||
|
this.btnCheckScript.Text = "Validate Script";
|
||||||
|
this.btnCheckScript.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCheckScript.Click += new System.EventHandler(this.btnCheckScript_Click);
|
||||||
|
//
|
||||||
|
// btnSaveRoom
|
||||||
|
//
|
||||||
|
this.btnSaveRoom.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.btnSaveRoom.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.btnSaveRoom.Name = "btnSaveRoom";
|
||||||
|
this.btnSaveRoom.Size = new System.Drawing.Size(203, 23);
|
||||||
|
this.btnSaveRoom.TabIndex = 6;
|
||||||
|
this.btnSaveRoom.Text = "Save Room";
|
||||||
|
this.btnSaveRoom.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveRoom.Click += new System.EventHandler(this.btnSaveRoom_Click);
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
this.groupBox2.Controls.Add(this.propertyRoom);
|
||||||
|
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.groupBox2.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.groupBox2.Name = "groupBox2";
|
||||||
|
this.groupBox2.Size = new System.Drawing.Size(209, 470);
|
||||||
|
this.groupBox2.TabIndex = 0;
|
||||||
|
this.groupBox2.TabStop = false;
|
||||||
|
this.groupBox2.Text = "Room Setup";
|
||||||
|
//
|
||||||
|
// propertyRoom
|
||||||
|
//
|
||||||
|
this.propertyRoom.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.propertyRoom.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.propertyRoom.Name = "propertyRoom";
|
||||||
|
this.propertyRoom.Size = new System.Drawing.Size(203, 451);
|
||||||
|
this.propertyRoom.TabIndex = 3;
|
||||||
|
this.propertyRoom.ToolbarVisible = false;
|
||||||
|
//
|
||||||
|
// containerDesigner
|
||||||
|
//
|
||||||
|
this.containerDesigner.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.containerDesigner.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.containerDesigner.Name = "containerDesigner";
|
||||||
|
this.containerDesigner.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// containerDesigner.Panel1
|
||||||
|
//
|
||||||
|
this.containerDesigner.Panel1.Controls.Add(this.groupBox4);
|
||||||
|
//
|
||||||
|
// containerDesigner.Panel2
|
||||||
|
//
|
||||||
|
this.containerDesigner.Panel2.Controls.Add(this.groupBox5);
|
||||||
|
this.containerDesigner.Size = new System.Drawing.Size(575, 562);
|
||||||
|
this.containerDesigner.SplitterDistance = 318;
|
||||||
|
this.containerDesigner.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox4
|
||||||
|
//
|
||||||
|
this.groupBox4.Controls.Add(this.tabObjects);
|
||||||
|
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.groupBox4.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.groupBox4.Name = "groupBox4";
|
||||||
|
this.groupBox4.Size = new System.Drawing.Size(575, 318);
|
||||||
|
this.groupBox4.TabIndex = 2;
|
||||||
|
this.groupBox4.TabStop = false;
|
||||||
|
this.groupBox4.Text = "Object Management";
|
||||||
|
//
|
||||||
|
// tabObjects
|
||||||
|
//
|
||||||
|
this.tabObjects.Controls.Add(this.tabScript);
|
||||||
|
this.tabObjects.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.tabObjects.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.tabObjects.Name = "tabObjects";
|
||||||
|
this.tabObjects.SelectedIndex = 0;
|
||||||
|
this.tabObjects.Size = new System.Drawing.Size(569, 299);
|
||||||
|
this.tabObjects.TabIndex = 0;
|
||||||
|
this.tabObjects.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// 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(561, 273);
|
||||||
|
this.tabScript.TabIndex = 3;
|
||||||
|
this.tabScript.Text = "Script";
|
||||||
|
this.tabScript.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// txtScript
|
||||||
|
//
|
||||||
|
this.txtScript.AcceptsTab = true;
|
||||||
|
this.txtScript.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.txtScript.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.txtScript.Name = "txtScript";
|
||||||
|
this.txtScript.Size = new System.Drawing.Size(555, 267);
|
||||||
|
this.txtScript.TabIndex = 0;
|
||||||
|
this.txtScript.Text = "";
|
||||||
|
this.txtScript.TextChanged += new System.EventHandler(this.txtScript_TextChanged);
|
||||||
|
//
|
||||||
|
// groupBox5
|
||||||
|
//
|
||||||
|
this.groupBox5.Controls.Add(this.groupBox7);
|
||||||
|
this.groupBox5.Controls.Add(this.groupBox6);
|
||||||
|
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.groupBox5.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.groupBox5.Name = "groupBox5";
|
||||||
|
this.groupBox5.Size = new System.Drawing.Size(575, 240);
|
||||||
|
this.groupBox5.TabIndex = 0;
|
||||||
|
this.groupBox5.TabStop = false;
|
||||||
|
this.groupBox5.Text = "Door Installation";
|
||||||
|
//
|
||||||
|
// groupBox7
|
||||||
|
//
|
||||||
|
this.groupBox7.Controls.Add(this.groupBox10);
|
||||||
|
this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.groupBox7.Location = new System.Drawing.Point(174, 16);
|
||||||
|
this.groupBox7.Name = "groupBox7";
|
||||||
|
this.groupBox7.Size = new System.Drawing.Size(398, 221);
|
||||||
|
this.groupBox7.TabIndex = 1;
|
||||||
|
this.groupBox7.TabStop = false;
|
||||||
|
this.groupBox7.Text = "Install Options";
|
||||||
|
//
|
||||||
|
// groupBox10
|
||||||
|
//
|
||||||
|
this.groupBox10.Controls.Add(this.propertyDoor);
|
||||||
|
this.groupBox10.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.groupBox10.Location = new System.Drawing.Point(39, 16);
|
||||||
|
this.groupBox10.Name = "groupBox10";
|
||||||
|
this.groupBox10.Size = new System.Drawing.Size(356, 202);
|
||||||
|
this.groupBox10.TabIndex = 7;
|
||||||
|
this.groupBox10.TabStop = false;
|
||||||
|
this.groupBox10.Text = "Door Setup";
|
||||||
|
//
|
||||||
|
// propertyDoor
|
||||||
|
//
|
||||||
|
this.propertyDoor.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.propertyDoor.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.propertyDoor.Name = "propertyDoor";
|
||||||
|
this.propertyDoor.Size = new System.Drawing.Size(350, 183);
|
||||||
|
this.propertyDoor.TabIndex = 4;
|
||||||
|
this.propertyDoor.ToolbarVisible = false;
|
||||||
|
this.propertyDoor.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyDoor_PropertyValueChanged);
|
||||||
|
//
|
||||||
|
// groupBox6
|
||||||
|
//
|
||||||
|
this.groupBox6.Controls.Add(this.lstDirections);
|
||||||
|
this.groupBox6.Dock = System.Windows.Forms.DockStyle.Left;
|
||||||
|
this.groupBox6.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.groupBox6.Name = "groupBox6";
|
||||||
|
this.groupBox6.Size = new System.Drawing.Size(171, 221);
|
||||||
|
this.groupBox6.TabIndex = 0;
|
||||||
|
this.groupBox6.TabStop = false;
|
||||||
|
this.groupBox6.Text = "Available Directions";
|
||||||
|
//
|
||||||
|
// lstDirections
|
||||||
|
//
|
||||||
|
this.lstDirections.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.lstDirections.FormattingEnabled = true;
|
||||||
|
this.lstDirections.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.lstDirections.Name = "lstDirections";
|
||||||
|
this.lstDirections.Size = new System.Drawing.Size(165, 199);
|
||||||
|
this.lstDirections.TabIndex = 0;
|
||||||
|
this.lstDirections.SelectedIndexChanged += new System.EventHandler(this.lstDirections_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// frmMain
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(792, 564);
|
||||||
|
this.Controls.Add(this.containerMain);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "frmMain";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Mud Designer: Room Designer";
|
||||||
|
this.containerMain.Panel1.ResumeLayout(false);
|
||||||
|
this.containerMain.Panel2.ResumeLayout(false);
|
||||||
|
this.containerMain.ResumeLayout(false);
|
||||||
|
this.containerSidebar.Panel1.ResumeLayout(false);
|
||||||
|
this.containerSidebar.Panel2.ResumeLayout(false);
|
||||||
|
this.containerSidebar.ResumeLayout(false);
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox2.ResumeLayout(false);
|
||||||
|
this.containerDesigner.Panel1.ResumeLayout(false);
|
||||||
|
this.containerDesigner.Panel2.ResumeLayout(false);
|
||||||
|
this.containerDesigner.ResumeLayout(false);
|
||||||
|
this.groupBox4.ResumeLayout(false);
|
||||||
|
this.tabObjects.ResumeLayout(false);
|
||||||
|
this.tabScript.ResumeLayout(false);
|
||||||
|
this.groupBox5.ResumeLayout(false);
|
||||||
|
this.groupBox7.ResumeLayout(false);
|
||||||
|
this.groupBox10.ResumeLayout(false);
|
||||||
|
this.groupBox6.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer containerMain;
|
||||||
|
private System.Windows.Forms.SplitContainer containerSidebar;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox2;
|
||||||
|
private System.Windows.Forms.PropertyGrid propertyRoom;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.SplitContainer containerDesigner;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox4;
|
||||||
|
private System.Windows.Forms.TabControl tabObjects;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox5;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox6;
|
||||||
|
private System.Windows.Forms.ListBox lstDirections;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox7;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox10;
|
||||||
|
private System.Windows.Forms.PropertyGrid propertyDoor;
|
||||||
|
private System.Windows.Forms.Button btnCloseEditor;
|
||||||
|
private System.Windows.Forms.Button btnCheckScript;
|
||||||
|
private System.Windows.Forms.Button btnSaveRoom;
|
||||||
|
private System.Windows.Forms.TabPage tabScript;
|
||||||
|
private System.Windows.Forms.RichTextBox txtScript;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
120
Mud Designer/Editors/RoomDesigner.resx
Normal file
120
Mud Designer/Editors/RoomDesigner.resx
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
64
Mud Designer/Editors/ToolkitLauncher.cs
Normal file
64
Mud Designer/Editors/ToolkitLauncher.cs
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class ToolkitLauncher : Form
|
||||||
|
{
|
||||||
|
public const int VersionMajor = 1;
|
||||||
|
public const int VersionMinor = 0;
|
||||||
|
public const int VersionRevision = 0;
|
||||||
|
public string version = VersionMajor.ToString() + "." + VersionMinor.ToString() + "." + VersionRevision.ToString();
|
||||||
|
|
||||||
|
public ToolkitLauncher()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.Text = "Mud Designer Beta " + version;
|
||||||
|
|
||||||
|
MessageBox.Show("Please note that the Zone Builder and Room Designers will be removed from this editor as a point of access here pretty soon.\n"
|
||||||
|
+ "If you need to access one of these editors you will need to use the Realm Explorer.", "Mud Designer");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnProjectSettings_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ProjectSettings form = new ProjectSettings();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCurrencyEditor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CurrencyEditor form = new CurrencyEditor();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnRoomDesigner_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
RoomDesigner form = new RoomDesigner();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnRealmExplorer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
RealmExplorer form = new RealmExplorer();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnZoneBuilder_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ZoneBuilder form = new ZoneBuilder();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
386
Mud Designer/Editors/ToolkitLauncher.designer.cs
generated
Normal file
386
Mud Designer/Editors/ToolkitLauncher.designer.cs
generated
Normal file
|
@ -0,0 +1,386 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class ToolkitLauncher
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
|
this.btnLogo = new System.Windows.Forms.Button();
|
||||||
|
this.tabEditors = new System.Windows.Forms.TabControl();
|
||||||
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
|
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||||
|
this.btnProjectSettings = new System.Windows.Forms.Button();
|
||||||
|
this.btnCurrencyEditor = new System.Windows.Forms.Button();
|
||||||
|
this.btnRealmExplorer = new System.Windows.Forms.Button();
|
||||||
|
this.btnZoneBuilder = new System.Windows.Forms.Button();
|
||||||
|
this.btnRoomDesigner = new System.Windows.Forms.Button();
|
||||||
|
this.tabFunctions = new System.Windows.Forms.TabPage();
|
||||||
|
this.groupBox9 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.groupBox14 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.groupBox12 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.comReturnTypes = new System.Windows.Forms.ComboBox();
|
||||||
|
this.groupBox13 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.txtFunctionName = new System.Windows.Forms.TextBox();
|
||||||
|
this.groupBox11 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.comFunctions = new System.Windows.Forms.ComboBox();
|
||||||
|
this.groupBox8 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.txtScript = new System.Windows.Forms.RichTextBox();
|
||||||
|
this.tabVariables = new System.Windows.Forms.TabPage();
|
||||||
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
|
this.splitContainer1.Panel2.SuspendLayout();
|
||||||
|
this.splitContainer1.SuspendLayout();
|
||||||
|
this.tabEditors.SuspendLayout();
|
||||||
|
this.tabPage1.SuspendLayout();
|
||||||
|
this.flowLayoutPanel1.SuspendLayout();
|
||||||
|
this.tabFunctions.SuspendLayout();
|
||||||
|
this.groupBox9.SuspendLayout();
|
||||||
|
this.groupBox12.SuspendLayout();
|
||||||
|
this.groupBox13.SuspendLayout();
|
||||||
|
this.groupBox11.SuspendLayout();
|
||||||
|
this.groupBox8.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// 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.Name = "splitContainer1";
|
||||||
|
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.btnLogo);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.tabEditors);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(639, 383);
|
||||||
|
this.splitContainer1.SplitterDistance = 154;
|
||||||
|
this.splitContainer1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// btnLogo
|
||||||
|
//
|
||||||
|
this.btnLogo.BackColor = System.Drawing.Color.Black;
|
||||||
|
this.btnLogo.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.btnLogo.FlatAppearance.BorderColor = System.Drawing.Color.Gray;
|
||||||
|
this.btnLogo.FlatAppearance.BorderSize = 5;
|
||||||
|
this.btnLogo.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Black;
|
||||||
|
this.btnLogo.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black;
|
||||||
|
this.btnLogo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnLogo.Font = new System.Drawing.Font("Kootenay", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnLogo.ForeColor = System.Drawing.Color.Gray;
|
||||||
|
this.btnLogo.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.btnLogo.Name = "btnLogo";
|
||||||
|
this.btnLogo.Size = new System.Drawing.Size(639, 154);
|
||||||
|
this.btnLogo.TabIndex = 0;
|
||||||
|
this.btnLogo.Text = "MUD Designer HUB \r\nBeta 1.0\r\n";
|
||||||
|
this.btnLogo.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
|
// tabEditors
|
||||||
|
//
|
||||||
|
this.tabEditors.Controls.Add(this.tabPage1);
|
||||||
|
this.tabEditors.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.tabEditors.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.tabEditors.Name = "tabEditors";
|
||||||
|
this.tabEditors.SelectedIndex = 0;
|
||||||
|
this.tabEditors.Size = new System.Drawing.Size(639, 225);
|
||||||
|
this.tabEditors.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabPage1
|
||||||
|
//
|
||||||
|
this.tabPage1.Controls.Add(this.flowLayoutPanel1);
|
||||||
|
this.tabPage1.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabPage1.Name = "tabPage1";
|
||||||
|
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabPage1.Size = new System.Drawing.Size(631, 199);
|
||||||
|
this.tabPage1.TabIndex = 0;
|
||||||
|
this.tabPage1.Text = "Available Editors";
|
||||||
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// flowLayoutPanel1
|
||||||
|
//
|
||||||
|
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.Controls.Add(this.btnRoomDesigner);
|
||||||
|
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||||
|
this.flowLayoutPanel1.Size = new System.Drawing.Size(625, 193);
|
||||||
|
this.flowLayoutPanel1.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// btnProjectSettings
|
||||||
|
//
|
||||||
|
this.btnProjectSettings.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnProjectSettings.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnProjectSettings.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.btnProjectSettings.Name = "btnProjectSettings";
|
||||||
|
this.btnProjectSettings.Size = new System.Drawing.Size(147, 55);
|
||||||
|
this.btnProjectSettings.TabIndex = 0;
|
||||||
|
this.btnProjectSettings.Text = "Project Settings";
|
||||||
|
this.btnProjectSettings.UseVisualStyleBackColor = true;
|
||||||
|
this.btnProjectSettings.Click += new System.EventHandler(this.btnProjectSettings_Click);
|
||||||
|
//
|
||||||
|
// btnCurrencyEditor
|
||||||
|
//
|
||||||
|
this.btnCurrencyEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnCurrencyEditor.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnCurrencyEditor.Location = new System.Drawing.Point(156, 3);
|
||||||
|
this.btnCurrencyEditor.Name = "btnCurrencyEditor";
|
||||||
|
this.btnCurrencyEditor.Size = new System.Drawing.Size(147, 55);
|
||||||
|
this.btnCurrencyEditor.TabIndex = 1;
|
||||||
|
this.btnCurrencyEditor.Text = "Currency Editor";
|
||||||
|
this.btnCurrencyEditor.UseVisualStyleBackColor = true;
|
||||||
|
this.btnCurrencyEditor.Click += new System.EventHandler(this.btnCurrencyEditor_Click);
|
||||||
|
//
|
||||||
|
// btnRealmExplorer
|
||||||
|
//
|
||||||
|
this.btnRealmExplorer.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnRealmExplorer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnRealmExplorer.Location = new System.Drawing.Point(309, 3);
|
||||||
|
this.btnRealmExplorer.Name = "btnRealmExplorer";
|
||||||
|
this.btnRealmExplorer.Size = new System.Drawing.Size(147, 55);
|
||||||
|
this.btnRealmExplorer.TabIndex = 3;
|
||||||
|
this.btnRealmExplorer.Text = "Realm Explorer";
|
||||||
|
this.btnRealmExplorer.UseVisualStyleBackColor = true;
|
||||||
|
this.btnRealmExplorer.Click += new System.EventHandler(this.btnRealmExplorer_Click);
|
||||||
|
//
|
||||||
|
// 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);
|
||||||
|
//
|
||||||
|
// btnRoomDesigner
|
||||||
|
//
|
||||||
|
this.btnRoomDesigner.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.btnRoomDesigner.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.btnRoomDesigner.Location = new System.Drawing.Point(3, 64);
|
||||||
|
this.btnRoomDesigner.Name = "btnRoomDesigner";
|
||||||
|
this.btnRoomDesigner.Size = new System.Drawing.Size(147, 55);
|
||||||
|
this.btnRoomDesigner.TabIndex = 5;
|
||||||
|
this.btnRoomDesigner.Text = "Room Designer";
|
||||||
|
this.btnRoomDesigner.UseVisualStyleBackColor = true;
|
||||||
|
this.btnRoomDesigner.Click += new System.EventHandler(this.btnRoomDesigner_Click);
|
||||||
|
//
|
||||||
|
// tabFunctions
|
||||||
|
//
|
||||||
|
this.tabFunctions.Controls.Add(this.groupBox9);
|
||||||
|
this.tabFunctions.Controls.Add(this.groupBox8);
|
||||||
|
this.tabFunctions.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabFunctions.Name = "tabFunctions";
|
||||||
|
this.tabFunctions.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabFunctions.Size = new System.Drawing.Size(526, 247);
|
||||||
|
this.tabFunctions.TabIndex = 0;
|
||||||
|
this.tabFunctions.Text = "Functions";
|
||||||
|
this.tabFunctions.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// groupBox9
|
||||||
|
//
|
||||||
|
this.groupBox9.Controls.Add(this.groupBox14);
|
||||||
|
this.groupBox9.Controls.Add(this.groupBox12);
|
||||||
|
this.groupBox9.Controls.Add(this.groupBox13);
|
||||||
|
this.groupBox9.Controls.Add(this.groupBox11);
|
||||||
|
this.groupBox9.Dock = System.Windows.Forms.DockStyle.Right;
|
||||||
|
this.groupBox9.Location = new System.Drawing.Point(365, 3);
|
||||||
|
this.groupBox9.Name = "groupBox9";
|
||||||
|
this.groupBox9.Size = new System.Drawing.Size(158, 241);
|
||||||
|
this.groupBox9.TabIndex = 3;
|
||||||
|
this.groupBox9.TabStop = false;
|
||||||
|
this.groupBox9.Text = "Script Setup";
|
||||||
|
//
|
||||||
|
// groupBox14
|
||||||
|
//
|
||||||
|
this.groupBox14.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.groupBox14.Location = new System.Drawing.Point(3, 139);
|
||||||
|
this.groupBox14.Name = "groupBox14";
|
||||||
|
this.groupBox14.Size = new System.Drawing.Size(152, 96);
|
||||||
|
this.groupBox14.TabIndex = 8;
|
||||||
|
this.groupBox14.TabStop = false;
|
||||||
|
//
|
||||||
|
// groupBox12
|
||||||
|
//
|
||||||
|
this.groupBox12.Controls.Add(this.comReturnTypes);
|
||||||
|
this.groupBox12.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.groupBox12.Location = new System.Drawing.Point(3, 98);
|
||||||
|
this.groupBox12.Name = "groupBox12";
|
||||||
|
this.groupBox12.Size = new System.Drawing.Size(152, 41);
|
||||||
|
this.groupBox12.TabIndex = 7;
|
||||||
|
this.groupBox12.TabStop = false;
|
||||||
|
this.groupBox12.Text = "Returnable Types";
|
||||||
|
//
|
||||||
|
// comReturnTypes
|
||||||
|
//
|
||||||
|
this.comReturnTypes.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.comReturnTypes.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.comReturnTypes.FormattingEnabled = true;
|
||||||
|
this.comReturnTypes.Items.AddRange(new object[] {
|
||||||
|
"bool",
|
||||||
|
"int",
|
||||||
|
"string"});
|
||||||
|
this.comReturnTypes.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.comReturnTypes.Name = "comReturnTypes";
|
||||||
|
this.comReturnTypes.Size = new System.Drawing.Size(146, 21);
|
||||||
|
this.comReturnTypes.Sorted = true;
|
||||||
|
this.comReturnTypes.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox13
|
||||||
|
//
|
||||||
|
this.groupBox13.Controls.Add(this.txtFunctionName);
|
||||||
|
this.groupBox13.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.groupBox13.Location = new System.Drawing.Point(3, 57);
|
||||||
|
this.groupBox13.Name = "groupBox13";
|
||||||
|
this.groupBox13.Size = new System.Drawing.Size(152, 41);
|
||||||
|
this.groupBox13.TabIndex = 6;
|
||||||
|
this.groupBox13.TabStop = false;
|
||||||
|
this.groupBox13.Text = "Function Name";
|
||||||
|
//
|
||||||
|
// txtFunctionName
|
||||||
|
//
|
||||||
|
this.txtFunctionName.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.txtFunctionName.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.txtFunctionName.Name = "txtFunctionName";
|
||||||
|
this.txtFunctionName.Size = new System.Drawing.Size(146, 20);
|
||||||
|
this.txtFunctionName.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox11
|
||||||
|
//
|
||||||
|
this.groupBox11.Controls.Add(this.comFunctions);
|
||||||
|
this.groupBox11.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.groupBox11.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.groupBox11.Name = "groupBox11";
|
||||||
|
this.groupBox11.Size = new System.Drawing.Size(152, 41);
|
||||||
|
this.groupBox11.TabIndex = 0;
|
||||||
|
this.groupBox11.TabStop = false;
|
||||||
|
this.groupBox11.Text = "Existing Functions";
|
||||||
|
//
|
||||||
|
// comFunctions
|
||||||
|
//
|
||||||
|
this.comFunctions.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.comFunctions.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.comFunctions.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||||
|
this.comFunctions.FormattingEnabled = true;
|
||||||
|
this.comFunctions.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.comFunctions.Name = "comFunctions";
|
||||||
|
this.comFunctions.Size = new System.Drawing.Size(146, 21);
|
||||||
|
this.comFunctions.Sorted = true;
|
||||||
|
this.comFunctions.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// groupBox8
|
||||||
|
//
|
||||||
|
this.groupBox8.Controls.Add(this.txtScript);
|
||||||
|
this.groupBox8.Dock = System.Windows.Forms.DockStyle.Left;
|
||||||
|
this.groupBox8.Location = new System.Drawing.Point(3, 3);
|
||||||
|
this.groupBox8.Name = "groupBox8";
|
||||||
|
this.groupBox8.Size = new System.Drawing.Size(359, 241);
|
||||||
|
this.groupBox8.TabIndex = 2;
|
||||||
|
this.groupBox8.TabStop = false;
|
||||||
|
this.groupBox8.Text = "Room Script";
|
||||||
|
//
|
||||||
|
// txtScript
|
||||||
|
//
|
||||||
|
this.txtScript.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.txtScript.Location = new System.Drawing.Point(3, 16);
|
||||||
|
this.txtScript.Name = "txtScript";
|
||||||
|
this.txtScript.Size = new System.Drawing.Size(353, 222);
|
||||||
|
this.txtScript.TabIndex = 0;
|
||||||
|
this.txtScript.Text = "";
|
||||||
|
//
|
||||||
|
// tabVariables
|
||||||
|
//
|
||||||
|
this.tabVariables.Location = new System.Drawing.Point(4, 22);
|
||||||
|
this.tabVariables.Name = "tabVariables";
|
||||||
|
this.tabVariables.Padding = new System.Windows.Forms.Padding(3);
|
||||||
|
this.tabVariables.Size = new System.Drawing.Size(526, 247);
|
||||||
|
this.tabVariables.TabIndex = 1;
|
||||||
|
this.tabVariables.Text = "Variables";
|
||||||
|
this.tabVariables.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// ToolkitLauncher
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(639, 383);
|
||||||
|
this.Controls.Add(this.splitContainer1);
|
||||||
|
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "ToolkitLauncher";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Mud Designer Beta";
|
||||||
|
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||||
|
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||||
|
this.splitContainer1.ResumeLayout(false);
|
||||||
|
this.tabEditors.ResumeLayout(false);
|
||||||
|
this.tabPage1.ResumeLayout(false);
|
||||||
|
this.flowLayoutPanel1.ResumeLayout(false);
|
||||||
|
this.tabFunctions.ResumeLayout(false);
|
||||||
|
this.groupBox9.ResumeLayout(false);
|
||||||
|
this.groupBox12.ResumeLayout(false);
|
||||||
|
this.groupBox13.ResumeLayout(false);
|
||||||
|
this.groupBox13.PerformLayout();
|
||||||
|
this.groupBox11.ResumeLayout(false);
|
||||||
|
this.groupBox8.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.Button btnLogo;
|
||||||
|
private System.Windows.Forms.TabControl tabEditors;
|
||||||
|
private System.Windows.Forms.TabPage tabPage1;
|
||||||
|
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||||
|
private System.Windows.Forms.Button btnProjectSettings;
|
||||||
|
private System.Windows.Forms.Button btnCurrencyEditor;
|
||||||
|
private System.Windows.Forms.TabPage tabFunctions;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox9;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox14;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox12;
|
||||||
|
private System.Windows.Forms.ComboBox comReturnTypes;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox13;
|
||||||
|
private System.Windows.Forms.TextBox txtFunctionName;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox11;
|
||||||
|
private System.Windows.Forms.ComboBox comFunctions;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox8;
|
||||||
|
private System.Windows.Forms.RichTextBox txtScript;
|
||||||
|
private System.Windows.Forms.TabPage tabVariables;
|
||||||
|
private System.Windows.Forms.Button btnRealmExplorer;
|
||||||
|
private System.Windows.Forms.Button btnZoneBuilder;
|
||||||
|
private System.Windows.Forms.Button btnRoomDesigner;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
123
Mud Designer/Editors/ToolkitLauncher.resx
Normal file
123
Mud Designer/Editors/ToolkitLauncher.resx
Normal file
|
@ -0,0 +1,123 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<metadata name="splitContainer1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
</root>
|
108
Mud Designer/Editors/ZoneBuilder.cs
Normal file
108
Mud Designer/Editors/ZoneBuilder.cs
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
using ManagedScripting;
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
public partial class ZoneBuilder : Form
|
||||||
|
{
|
||||||
|
Zone _CurrentZone;
|
||||||
|
Room _CurrentRoom;
|
||||||
|
ScriptingEngine _ScriptEngine;
|
||||||
|
|
||||||
|
public ZoneBuilder()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_CurrentRoom = new Room();
|
||||||
|
_CurrentZone = new Zone();
|
||||||
|
_ScriptEngine = new ScriptingEngine();
|
||||||
|
_ScriptEngine.CompileStyle = ManagedScripting.Compilers.BaseCompiler.ScriptCompileStyle.CompileToMemory;
|
||||||
|
_ScriptEngine.Compiler = ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||||
|
|
||||||
|
propertyZone.SelectedObject = _CurrentZone;
|
||||||
|
txtScript.Text = _CurrentZone.Script;
|
||||||
|
|
||||||
|
string[] rooms = System.IO.Directory.GetFiles(MudEngine.Engine.GetDataPath(Engine.SaveDataTypes.Rooms), "*.room");
|
||||||
|
|
||||||
|
foreach (string room in rooms)
|
||||||
|
{
|
||||||
|
lstRooms.Items.Add(System.IO.Path.GetFileNameWithoutExtension(room));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnRoomEditor_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult result;
|
||||||
|
string argument = "";
|
||||||
|
|
||||||
|
if (lstRooms.SelectedItem != null)
|
||||||
|
{
|
||||||
|
result = MessageBox.Show("You have a room selected, are you wanting to edit it?",
|
||||||
|
"Zone Builder", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
|
||||||
|
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case DialogResult.Yes:
|
||||||
|
argument += " \"room=" + lstRooms.SelectedItem.ToString() + ".room\"";
|
||||||
|
break;
|
||||||
|
case DialogResult.Cancel:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RoomDesigner form = new RoomDesigner();
|
||||||
|
|
||||||
|
form.Show();
|
||||||
|
|
||||||
|
MessageBox.Show("Broke.");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnClose_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Application.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSaveZone_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string path = Engine.GetDataPath(Engine.SaveDataTypes.Zones);
|
||||||
|
string filename = System.IO.Path.Combine(path, _CurrentZone.Name + ".zone");
|
||||||
|
|
||||||
|
FileSystem.Save(filename, _CurrentZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnNewZone_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_CurrentZone = new Zone();
|
||||||
|
_CurrentRoom = new Room();
|
||||||
|
propertyZone.SelectedObject = _CurrentZone;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnValidateScript_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_ScriptEngine.Compiler = ManagedScripting.ScriptingEngine.CompilerSelections.SourceCompiler;
|
||||||
|
_ScriptEngine.AddReference(Application.StartupPath + "/MUDEngine.dll");
|
||||||
|
|
||||||
|
string code = "namespace MudDesigner.MudEngine.Objects.Environment\n"
|
||||||
|
+ "{\n"
|
||||||
|
+ " public class " + _CurrentZone.Name.Replace(" ", "") + " : Zone\n"
|
||||||
|
+ " {\n"
|
||||||
|
+ " " + txtScript.Text + "\n"
|
||||||
|
+ " }\n"
|
||||||
|
+ "}\n";
|
||||||
|
MessageBox.Show(_ScriptEngine.Compile(code), "Script Compiling", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
287
Mud Designer/Editors/ZoneBuilder.designer.cs
generated
Normal file
287
Mud Designer/Editors/ZoneBuilder.designer.cs
generated
Normal file
|
@ -0,0 +1,287 @@
|
||||||
|
namespace MudDesigner.Editors
|
||||||
|
{
|
||||||
|
partial class ZoneBuilder
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
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.btnValidateScript = new System.Windows.Forms.Button();
|
||||||
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
|
this.btnSaveZone = new System.Windows.Forms.Button();
|
||||||
|
this.btnDeleteZone = new System.Windows.Forms.Button();
|
||||||
|
this.btnNewZone = 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.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.lstRooms = new System.Windows.Forms.ListBox();
|
||||||
|
this.btnRoomEditor = new System.Windows.Forms.Button();
|
||||||
|
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.tabScript.SuspendLayout();
|
||||||
|
this.groupBox2.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// splitContainer1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.splitContainer1.Name = "splitContainer1";
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel1
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.propertyZone);
|
||||||
|
this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
|
||||||
|
//
|
||||||
|
// splitContainer1.Panel2
|
||||||
|
//
|
||||||
|
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
|
||||||
|
this.splitContainer1.Size = new System.Drawing.Size(794, 574);
|
||||||
|
this.splitContainer1.SplitterDistance = 210;
|
||||||
|
this.splitContainer1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// propertyZone
|
||||||
|
//
|
||||||
|
this.propertyZone.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.propertyZone.Location = new System.Drawing.Point(0, 99);
|
||||||
|
this.propertyZone.Name = "propertyZone";
|
||||||
|
this.propertyZone.Size = new System.Drawing.Size(210, 475);
|
||||||
|
this.propertyZone.TabIndex = 1;
|
||||||
|
this.propertyZone.ToolbarVisible = false;
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.btnValidateScript);
|
||||||
|
this.groupBox1.Controls.Add(this.btnClose);
|
||||||
|
this.groupBox1.Controls.Add(this.btnSaveZone);
|
||||||
|
this.groupBox1.Controls.Add(this.btnDeleteZone);
|
||||||
|
this.groupBox1.Controls.Add(this.btnNewZone);
|
||||||
|
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(210, 99);
|
||||||
|
this.groupBox1.TabIndex = 0;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "Zone Setup";
|
||||||
|
//
|
||||||
|
// btnValidateScript
|
||||||
|
//
|
||||||
|
this.btnValidateScript.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.btnValidateScript.Location = new System.Drawing.Point(3, 73);
|
||||||
|
this.btnValidateScript.Name = "btnValidateScript";
|
||||||
|
this.btnValidateScript.Size = new System.Drawing.Size(204, 23);
|
||||||
|
this.btnValidateScript.TabIndex = 13;
|
||||||
|
this.btnValidateScript.Text = "Validate Script";
|
||||||
|
this.btnValidateScript.UseVisualStyleBackColor = true;
|
||||||
|
this.btnValidateScript.Click += new System.EventHandler(this.btnValidateScript_Click);
|
||||||
|
//
|
||||||
|
// btnClose
|
||||||
|
//
|
||||||
|
this.btnClose.Location = new System.Drawing.Point(110, 48);
|
||||||
|
this.btnClose.Name = "btnClose";
|
||||||
|
this.btnClose.Size = new System.Drawing.Size(97, 23);
|
||||||
|
this.btnClose.TabIndex = 12;
|
||||||
|
this.btnClose.Text = "Close Builder";
|
||||||
|
this.btnClose.UseVisualStyleBackColor = true;
|
||||||
|
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||||
|
//
|
||||||
|
// btnSaveZone
|
||||||
|
//
|
||||||
|
this.btnSaveZone.Location = new System.Drawing.Point(110, 19);
|
||||||
|
this.btnSaveZone.Name = "btnSaveZone";
|
||||||
|
this.btnSaveZone.Size = new System.Drawing.Size(97, 23);
|
||||||
|
this.btnSaveZone.TabIndex = 11;
|
||||||
|
this.btnSaveZone.Text = "Save Zone";
|
||||||
|
this.btnSaveZone.UseVisualStyleBackColor = true;
|
||||||
|
this.btnSaveZone.Click += new System.EventHandler(this.btnSaveZone_Click);
|
||||||
|
//
|
||||||
|
// btnDeleteZone
|
||||||
|
//
|
||||||
|
this.btnDeleteZone.Location = new System.Drawing.Point(3, 48);
|
||||||
|
this.btnDeleteZone.Name = "btnDeleteZone";
|
||||||
|
this.btnDeleteZone.Size = new System.Drawing.Size(102, 23);
|
||||||
|
this.btnDeleteZone.TabIndex = 10;
|
||||||
|
this.btnDeleteZone.Text = "Delete Zone";
|
||||||
|
this.btnDeleteZone.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// btnNewZone
|
||||||
|
//
|
||||||
|
this.btnNewZone.Location = new System.Drawing.Point(3, 19);
|
||||||
|
this.btnNewZone.Name = "btnNewZone";
|
||||||
|
this.btnNewZone.Size = new System.Drawing.Size(102, 23);
|
||||||
|
this.btnNewZone.TabIndex = 9;
|
||||||
|
this.btnNewZone.Text = "New Zone";
|
||||||
|
this.btnNewZone.UseVisualStyleBackColor = true;
|
||||||
|
this.btnNewZone.Click += new System.EventHandler(this.btnNewZone_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.groupBox2);
|
||||||
|
this.splitContainer2.Size = new System.Drawing.Size(580, 574);
|
||||||
|
this.splitContainer2.SplitterDistance = 365;
|
||||||
|
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(365, 574);
|
||||||
|
this.tabControl1.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// tabZoneCreation
|
||||||
|
//
|
||||||
|
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(357, 548);
|
||||||
|
this.tabZoneCreation.TabIndex = 0;
|
||||||
|
this.tabZoneCreation.Text = "Zone Creation";
|
||||||
|
this.tabZoneCreation.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(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, 3);
|
||||||
|
this.txtScript.Name = "txtScript";
|
||||||
|
this.txtScript.Size = new System.Drawing.Size(351, 542);
|
||||||
|
this.txtScript.TabIndex = 0;
|
||||||
|
this.txtScript.Text = "";
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
this.groupBox2.Controls.Add(this.lstRooms);
|
||||||
|
this.groupBox2.Controls.Add(this.btnRoomEditor);
|
||||||
|
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(211, 168);
|
||||||
|
this.groupBox2.TabIndex = 0;
|
||||||
|
this.groupBox2.TabStop = false;
|
||||||
|
this.groupBox2.Text = "Available Rooms";
|
||||||
|
//
|
||||||
|
// 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(205, 121);
|
||||||
|
this.lstRooms.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// btnRoomEditor
|
||||||
|
//
|
||||||
|
this.btnRoomEditor.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
|
this.btnRoomEditor.Location = new System.Drawing.Point(3, 142);
|
||||||
|
this.btnRoomEditor.Name = "btnRoomEditor";
|
||||||
|
this.btnRoomEditor.Size = new System.Drawing.Size(205, 23);
|
||||||
|
this.btnRoomEditor.TabIndex = 0;
|
||||||
|
this.btnRoomEditor.Text = "Build-A-Room";
|
||||||
|
this.btnRoomEditor.UseVisualStyleBackColor = true;
|
||||||
|
this.btnRoomEditor.Click += new System.EventHandler(this.btnRoomEditor_Click);
|
||||||
|
//
|
||||||
|
// frmMain
|
||||||
|
//
|
||||||
|
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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "frmMain";
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Zone Builder";
|
||||||
|
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.tabScript.ResumeLayout(false);
|
||||||
|
this.groupBox2.ResumeLayout(false);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.Button btnValidateScript;
|
||||||
|
private System.Windows.Forms.Button btnClose;
|
||||||
|
private System.Windows.Forms.Button btnSaveZone;
|
||||||
|
private System.Windows.Forms.Button btnDeleteZone;
|
||||||
|
private System.Windows.Forms.Button btnNewZone;
|
||||||
|
private System.Windows.Forms.PropertyGrid propertyZone;
|
||||||
|
private System.Windows.Forms.SplitContainer splitContainer2;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox2;
|
||||||
|
private System.Windows.Forms.ListBox lstRooms;
|
||||||
|
private System.Windows.Forms.Button btnRoomEditor;
|
||||||
|
private System.Windows.Forms.TabControl tabControl1;
|
||||||
|
private System.Windows.Forms.TabPage tabZoneCreation;
|
||||||
|
private System.Windows.Forms.TabPage tabScript;
|
||||||
|
private System.Windows.Forms.RichTextBox txtScript;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
120
Mud Designer/Editors/ZoneBuilder.resx
Normal file
120
Mud Designer/Editors/ZoneBuilder.resx
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
158
Mud Designer/Mud Designer.csproj
Normal file
158
Mud Designer/Mud Designer.csproj
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>9.0.21022</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{F0C50EA1-80F7-4CE6-93A3-A4E9F34F0434}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>MudDesigner</RootNamespace>
|
||||||
|
<AssemblyName>Mud Designer</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="ManagedScriptingWIN, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\ManagedScriptingWIN.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Xml.Linq">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data.DataSetExtensions">
|
||||||
|
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MudEngine\Engine.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\BaseObject.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Currency.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\Door.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\InitialLocation.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\Realm.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\Room.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\TravelDirections.cs" />
|
||||||
|
<Compile Include="MudEngine\GameObjects\Environment\Zone.cs" />
|
||||||
|
<Compile Include="MudEngine\ProjectInformation.cs" />
|
||||||
|
<Compile Include="MudEngine\Attributes\UnusableAttribute.cs" />
|
||||||
|
<Compile Include="Editors\CurrencyEditor.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\CurrencyEditor.designer.cs">
|
||||||
|
<DependentUpon>CurrencyEditor.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ZoneBuilder.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ZoneBuilder.designer.cs">
|
||||||
|
<DependentUpon>ZoneBuilder.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ToolkitLauncher.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ToolkitLauncher.designer.cs">
|
||||||
|
<DependentUpon>ToolkitLauncher.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\RoomDesigner.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\RoomDesigner.designer.cs">
|
||||||
|
<DependentUpon>RoomDesigner.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\RealmExplorer.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\RealmExplorer.designer.cs">
|
||||||
|
<DependentUpon>RealmExplorer.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ProjectSettings.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Editors\ProjectSettings.designer.cs">
|
||||||
|
<DependentUpon>ProjectSettings.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MudEngine\FileSystem\FileSystem.cs" />
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Editors\CurrencyEditor.resx">
|
||||||
|
<DependentUpon>CurrencyEditor.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Editors\ZoneBuilder.resx">
|
||||||
|
<DependentUpon>ZoneBuilder.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Editors\ToolkitLauncher.resx">
|
||||||
|
<DependentUpon>ToolkitLauncher.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Editors\RoomDesigner.resx">
|
||||||
|
<DependentUpon>RoomDesigner.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Editors\RealmExplorer.resx">
|
||||||
|
<DependentUpon>RealmExplorer.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Editors\ProjectSettings.resx">
|
||||||
|
<DependentUpon>ProjectSettings.cs</DependentUpon>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="MudEngine\FileSystem\XmlSerialization.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
26
Mud Designer/MudEngine/Attributes/UnusableAttribute.cs
Normal file
26
Mud Designer/MudEngine/Attributes/UnusableAttribute.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Attributes
|
||||||
|
{
|
||||||
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
|
||||||
|
public class UnusableAttribute : System.Attribute
|
||||||
|
{
|
||||||
|
private bool _IsUseable;
|
||||||
|
public UnusableAttribute (bool useable)
|
||||||
|
{
|
||||||
|
_IsUseable = useable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets if the class can be instanced or not. Regardless of what Type it inherits from
|
||||||
|
/// </summary>
|
||||||
|
public bool IsUseable
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
77
Mud Designer/MudEngine/Engine.cs
Normal file
77
Mud Designer/MudEngine/Engine.cs
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine
|
||||||
|
{
|
||||||
|
public class Engine
|
||||||
|
{
|
||||||
|
private const string _InstallLocation = @"C:\Codeplex\MudDesigner\Example\";
|
||||||
|
|
||||||
|
public enum SaveDataTypes
|
||||||
|
{
|
||||||
|
Root,
|
||||||
|
Currency,
|
||||||
|
Rooms,
|
||||||
|
Zones,
|
||||||
|
Realms,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to ensure that the paths needed to run the game exists.
|
||||||
|
/// If no path is supplied, the engine uses it's current install path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validatedPath"></param>
|
||||||
|
public static void ValidateDataPaths()
|
||||||
|
{
|
||||||
|
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");
|
||||||
|
ValidateDataPaths(rootPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks the supplied directory to ensure that all of the engines needed
|
||||||
|
/// data folders are created
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="InstallPath"></param>
|
||||||
|
public static void ValidateDataPaths(string InstallPath)
|
||||||
|
{
|
||||||
|
if (!InstallPath.EndsWith("data", true, null))
|
||||||
|
InstallPath = System.IO.Path.Combine(InstallPath, "Data");
|
||||||
|
|
||||||
|
if (!System.IO.Directory.Exists(InstallPath))
|
||||||
|
System.IO.Directory.CreateDirectory(InstallPath);
|
||||||
|
|
||||||
|
foreach (SaveDataTypes value in Enum.GetValues(typeof(SaveDataTypes)))
|
||||||
|
{
|
||||||
|
string dataType = value.ToString();
|
||||||
|
if (value.ToString() == "Root")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!System.IO.Directory.Exists(System.IO.Path.Combine(InstallPath, dataType)))
|
||||||
|
System.IO.Directory.CreateDirectory(System.IO.Path.Combine(InstallPath, dataType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the complete path to the specified data's save folder.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="DataType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetDataPath(SaveDataTypes DataType)
|
||||||
|
{
|
||||||
|
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");
|
||||||
|
|
||||||
|
if (DataType == SaveDataTypes.Root)
|
||||||
|
return rootPath;
|
||||||
|
else
|
||||||
|
return System.IO.Path.Combine(rootPath, DataType.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
52
Mud Designer/MudEngine/FileSystem/FileSystem.cs
Normal file
52
Mud Designer/MudEngine/FileSystem/FileSystem.cs
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.FileSystem
|
||||||
|
{
|
||||||
|
public static class FileSystem
|
||||||
|
{
|
||||||
|
public enum OutputFormats
|
||||||
|
{
|
||||||
|
XML = 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The filetype that the MUDs files will be saved as
|
||||||
|
/// </summary>
|
||||||
|
public static OutputFormats FileType
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Saves the object using the specified output format
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Filename"></param>
|
||||||
|
/// <param name="o"></param>
|
||||||
|
public static void Save(string Filename, object o)
|
||||||
|
{
|
||||||
|
if (FileType == OutputFormats.XML)
|
||||||
|
{
|
||||||
|
XmlSerialization.Save(Filename, o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the object using the specified FileType format
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Filename"></param>
|
||||||
|
/// <param name="o"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static object Load(string Filename, object o)
|
||||||
|
{
|
||||||
|
if (FileType == OutputFormats.XML)
|
||||||
|
{
|
||||||
|
return XmlSerialization.Load(Filename, o);
|
||||||
|
}
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
42
Mud Designer/MudEngine/FileSystem/XmlSerialization.cs
Normal file
42
Mud Designer/MudEngine/FileSystem/XmlSerialization.cs
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#region ====== Using Statements ======
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using System.IO;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.FileSystem
|
||||||
|
{
|
||||||
|
internal class XmlSerialization
|
||||||
|
{
|
||||||
|
internal static void Save(string Filename, object o)
|
||||||
|
{
|
||||||
|
Stream stream = File.Create(Filename);
|
||||||
|
|
||||||
|
XmlSerializer serializer = new XmlSerializer(o.GetType());
|
||||||
|
serializer.Serialize(stream, o);
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads an item via Xml Deserialization
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Filename">The Xml document to deserialize.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
internal static object Load(string Filename, object o)
|
||||||
|
{
|
||||||
|
Stream stream = File.OpenRead(Filename);
|
||||||
|
|
||||||
|
object obj = new object();
|
||||||
|
XmlSerializer serializer = new XmlSerializer(o.GetType());
|
||||||
|
obj = (object)serializer.Deserialize(stream);
|
||||||
|
|
||||||
|
stream.Close();
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
111
Mud Designer/MudEngine/GameObjects/BaseObject.cs
Normal file
111
Mud Designer/MudEngine/GameObjects/BaseObject.cs
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects
|
||||||
|
{
|
||||||
|
public class BaseObject
|
||||||
|
{
|
||||||
|
[Category("Object Setup")]
|
||||||
|
[RefreshProperties(RefreshProperties.All)] //Required to refresh Filename property in the editors propertygrid
|
||||||
|
public string Name
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Object Setup")]
|
||||||
|
public string Description
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public string Script { get; set; }
|
||||||
|
|
||||||
|
[ReadOnly(true)]
|
||||||
|
[Category("Object Setup")]
|
||||||
|
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.Name + "." + fileExtension;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the base object
|
||||||
|
/// </summary>
|
||||||
|
public BaseObject()
|
||||||
|
{
|
||||||
|
Script = "";
|
||||||
|
this.Name = DefaultName();
|
||||||
|
SetupScript();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ShouldSerializeName()
|
||||||
|
{
|
||||||
|
return this.Name != DefaultName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetName()
|
||||||
|
{
|
||||||
|
this.Name = DefaultName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string DefaultName()
|
||||||
|
{
|
||||||
|
return "New " + this.GetType().Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetupScript()
|
||||||
|
{
|
||||||
|
//Check if the realm script is empty. If so then generate a standard script for it.
|
||||||
|
if (Script == "")
|
||||||
|
{
|
||||||
|
//Instance a new method helper class
|
||||||
|
ManagedScripting.CodeBuilding.MethodSetup method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
string script = "";
|
||||||
|
//Setup our method. All objects inheriting from BaseObject will have the standard
|
||||||
|
//methods created for them.
|
||||||
|
string[] names = new string[] { "OnCreate", "OnDestroy", "OnEnter", "OnExit" };
|
||||||
|
foreach (string name in names)
|
||||||
|
{
|
||||||
|
method = new ManagedScripting.CodeBuilding.MethodSetup();
|
||||||
|
method.Name = name;
|
||||||
|
method.ReturnType = "void";
|
||||||
|
method.IsOverride = true;
|
||||||
|
method.Modifier = ManagedScripting.CodeBuilding.ClassGenerator.Modifiers.Public;
|
||||||
|
method.Code = new string[] { "base." + method.Name + "();" };
|
||||||
|
script = script.Insert(Script.Length, method.Create() + "\n");
|
||||||
|
}
|
||||||
|
Script = script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnEnter()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnExit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnCreate()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnDestroy()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
28
Mud Designer/MudEngine/GameObjects/Currency.cs
Normal file
28
Mud Designer/MudEngine/GameObjects/Currency.cs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects
|
||||||
|
{
|
||||||
|
public class Currency : BaseObject
|
||||||
|
{
|
||||||
|
[Category("Currency Settings")]
|
||||||
|
[DefaultValue(100)]
|
||||||
|
/// <summary>
|
||||||
|
/// The value of this currency. It should be how many 'base currency' it takes to equal 1 of this currency
|
||||||
|
/// </summary>
|
||||||
|
public int Value
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Currency()
|
||||||
|
{
|
||||||
|
this.Name = "New Currency";
|
||||||
|
this.Value = 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
66
Mud Designer/MudEngine/GameObjects/Environment/Door.cs
Normal file
66
Mud Designer/MudEngine/GameObjects/Environment/Door.cs
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
public class Door
|
||||||
|
{
|
||||||
|
public enum AvailableDoorStates
|
||||||
|
{
|
||||||
|
Uninstalled,
|
||||||
|
Installed,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Door Settings")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool IsLocked
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Door Settings")]
|
||||||
|
public string RequiredKey
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Door Settings")]
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int LevelRequirement
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Door Settings")]
|
||||||
|
[Description("Sets if the door is installed and useable within the room or not.")]
|
||||||
|
[DefaultValue(AvailableDoorStates.Uninstalled)]
|
||||||
|
public AvailableDoorStates DoorState
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public AvailableTravelDirections TravelDirection
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Door(AvailableTravelDirections TravelDirection)
|
||||||
|
{
|
||||||
|
this.TravelDirection = TravelDirection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Door()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
[Unusable(true)]
|
||||||
|
public struct StartingLocation
|
||||||
|
{
|
||||||
|
public Room Room;
|
||||||
|
public Zone Zone;
|
||||||
|
public Realm Realm;
|
||||||
|
}
|
||||||
|
}
|
18
Mud Designer/MudEngine/GameObjects/Environment/Realm.cs
Normal file
18
Mud Designer/MudEngine/GameObjects/Environment/Realm.cs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
public class Realm : BaseObject
|
||||||
|
{
|
||||||
|
[System.ComponentModel.Browsable(false)]
|
||||||
|
public List<Zone> Zones { get; set; }
|
||||||
|
|
||||||
|
public Realm()
|
||||||
|
{
|
||||||
|
Zones = new List<Zone>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
72
Mud Designer/MudEngine/GameObjects/Environment/Room.cs
Normal file
72
Mud Designer/MudEngine/GameObjects/Environment/Room.cs
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
public class Room : BaseObject
|
||||||
|
{
|
||||||
|
[Category("Room Senses")]
|
||||||
|
[DefaultValue("You don't smell anything unsual.")]
|
||||||
|
public string Smell
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Room Senses")]
|
||||||
|
[DefaultValue("You hear nothing of interest.")]
|
||||||
|
public string Listen
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Room Senses")]
|
||||||
|
[DefaultValue("You feel nothing.")]
|
||||||
|
public string Feel
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Room Information")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool StatDrain
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Room Information")]
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int StatDrainAmount
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Room Information")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool IsSafeRoom
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public List<Door> InstalledDoors;
|
||||||
|
|
||||||
|
public Room()
|
||||||
|
{
|
||||||
|
InstalledDoors = new List<Door>();
|
||||||
|
this.Feel = "You feel nothing.";
|
||||||
|
this.Listen = "You hear nothing of interest.";
|
||||||
|
this.Smell = "You don't smell anything unsual.";
|
||||||
|
this.StatDrainAmount = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
public enum AvailableTravelDirections
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
North,
|
||||||
|
South,
|
||||||
|
East,
|
||||||
|
West,
|
||||||
|
Up,
|
||||||
|
Down,
|
||||||
|
}
|
||||||
|
}
|
17
Mud Designer/MudEngine/GameObjects/Environment/Zone.cs
Normal file
17
Mud Designer/MudEngine/GameObjects/Environment/Zone.cs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine.Objects.Environment
|
||||||
|
{
|
||||||
|
public class Zone : BaseObject
|
||||||
|
{
|
||||||
|
[System.ComponentModel.Browsable(false)]
|
||||||
|
public string Realm
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
118
Mud Designer/MudEngine/ProjectInformation.cs
Normal file
118
Mud Designer/MudEngine/ProjectInformation.cs
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
namespace MudDesigner.MudEngine
|
||||||
|
{
|
||||||
|
[XmlInclude(typeof(StartingLocation))]
|
||||||
|
[XmlInclude(typeof(Currency))]
|
||||||
|
public class ProjectInformation
|
||||||
|
{
|
||||||
|
public enum TimeOfDayOptions
|
||||||
|
{
|
||||||
|
AlwaysDay,
|
||||||
|
AlwaysNight,
|
||||||
|
Transition,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Company Settings")]
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the name of the company
|
||||||
|
/// </summary>
|
||||||
|
public string CompanyName { get; set; }
|
||||||
|
|
||||||
|
[Category("Company Settings")]
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the companies website for this project
|
||||||
|
/// </summary>
|
||||||
|
public string Website { get; set; }
|
||||||
|
|
||||||
|
[Category("Project Settings")]
|
||||||
|
[Description("The name of the game.")]
|
||||||
|
public string GameTitle { get; set; }
|
||||||
|
|
||||||
|
[Category("Project Settings")]
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets if the game autosaves when the player changes locations.
|
||||||
|
/// </summary>
|
||||||
|
public bool AutoSave { get; set; }
|
||||||
|
|
||||||
|
[Category("Project Settings")]
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets if room names are hidden during console output.
|
||||||
|
/// </summary>
|
||||||
|
public bool HideRoomNames { get; set; }
|
||||||
|
|
||||||
|
[Category("Day Management")]
|
||||||
|
public TimeOfDayOptions TimeOfDay
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Day Management")]
|
||||||
|
[Description("Set how long in minutes it takes to transition from day to night.")]
|
||||||
|
public int TimeOfDayTransition
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Day Management")]
|
||||||
|
[Description("Sets how long in minutes a day lasts in the game world.")]
|
||||||
|
public int DayLength
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Category("Project Settings")]
|
||||||
|
public string Version { get; set; }
|
||||||
|
|
||||||
|
[Category("Game Currency")]
|
||||||
|
[Description("Sets the amount that the base currency is valued at.")]
|
||||||
|
public uint BaseCurrencyAmount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Category("Game Currency")]
|
||||||
|
public string BaseCurrencyName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TODO: Add Party support.
|
||||||
|
[Browsable(false)]
|
||||||
|
public List<Currency> CurrencyList { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public string ProjectPath { get; set; }
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public StartingLocation InitialLocation
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Browsable(false)]
|
||||||
|
public string Story
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProjectInformation()
|
||||||
|
{
|
||||||
|
CurrencyList = new List<Currency>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
Mud Designer/Program.cs
Normal file
36
Mud Designer/Program.cs
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
//MudEngine
|
||||||
|
using MudDesigner.MudEngine;
|
||||||
|
using MudDesigner.MudEngine.Attributes;
|
||||||
|
using MudDesigner.MudEngine.FileSystem;
|
||||||
|
using MudDesigner.MudEngine.Objects;
|
||||||
|
using MudDesigner.MudEngine.Objects.Environment;
|
||||||
|
|
||||||
|
namespace MudDesigner
|
||||||
|
{
|
||||||
|
static class Program
|
||||||
|
{
|
||||||
|
public static ProjectInformation Project{ get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// The main entry point for the application.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Engine.ValidateDataPaths();
|
||||||
|
FileSystem.FileType = FileSystem.OutputFormats.XML;
|
||||||
|
Project = new ProjectInformation();
|
||||||
|
|
||||||
|
string filename = System.IO.Path.Combine(Engine.GetDataPath(Engine.SaveDataTypes.Root), "Project.Xml");
|
||||||
|
if (System.IO.File.Exists(filename))
|
||||||
|
Project = (ProjectInformation)FileSystem.Load(filename, Project);
|
||||||
|
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new MudDesigner.Editors.ToolkitLauncher());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
Mud Designer/Properties/AssemblyInfo.cs
Normal file
36
Mud Designer/Properties/AssemblyInfo.cs
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Mud Designer")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("Mud Designer")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2009")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("464bb276-5701-4663-9618-0d2617bccaf6")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
63
Mud Designer/Properties/Resources.Designer.cs
generated
Normal file
63
Mud Designer/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:2.0.50727.4200
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors.Properties {
|
||||||
|
using System;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
internal class Resources {
|
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
|
internal Resources() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
|
get {
|
||||||
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MudDesigner.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
|
get {
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
117
Mud Designer/Properties/Resources.resx
Normal file
117
Mud Designer/Properties/Resources.resx
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
26
Mud Designer/Properties/Settings.Designer.cs
generated
Normal file
26
Mud Designer/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:2.0.50727.4200
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace MudDesigner.Editors.Properties {
|
||||||
|
|
||||||
|
|
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
|
||||||
|
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
|
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||||
|
|
||||||
|
public static Settings Default {
|
||||||
|
get {
|
||||||
|
return defaultInstance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
7
Mud Designer/Properties/Settings.settings
Normal file
7
Mud Designer/Properties/Settings.settings
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
Loading…
Add table
Add a link
Reference in a new issue