diff --git a/..svnbridge/ManagedScriptingWIN.dll b/..svnbridge/ManagedScriptingWIN.dll
deleted file mode 100644
index 0814930..0000000
--- a/..svnbridge/ManagedScriptingWIN.dll
+++ /dev/null
@@ -1 +0,0 @@
-svn:mime-typeapplication/octet-stream
\ No newline at end of file
diff --git a/ManagedScriptingWIN.dll b/ManagedScriptingWIN.dll
deleted file mode 100644
index 4c2206a..0000000
Binary files a/ManagedScriptingWIN.dll and /dev/null differ
diff --git a/Mud Designer/Mud Designer.csproj b/Mud Designer/Mud Designer.csproj
index cfce8c9..6df5604 100644
--- a/Mud Designer/Mud Designer.csproj
+++ b/Mud Designer/Mud Designer.csproj
@@ -46,10 +46,6 @@
4
-
- False
- ..\ManagedScriptingWIN.dll
-
3.5
diff --git a/Mud Designer/MudEngine/Characters/BaseCharacter.cs b/Mud Designer/MudEngine/Characters/BaseCharacter.cs
index 597a65b..87d2839 100644
--- a/Mud Designer/MudEngine/Characters/BaseCharacter.cs
+++ b/Mud Designer/MudEngine/Characters/BaseCharacter.cs
@@ -22,20 +22,8 @@ namespace MudDesigner.MudEngine.Characters
{
if (CurrentRoom.DoorwayExist(travelDirection.ToString()))
{
- string fileName = "";
- if (CurrentRoom.Realm == "No Realm Associated.")
- {
- fileName = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Zones), CurrentRoom.Zone);
- fileName = Path.Combine(fileName, "Rooms");
- }
- else
- {
- fileName = Path.Combine(FileManager.GetDataPath(CurrentRoom.Realm, CurrentRoom.Zone), "Rooms");
- }
string connectedRoom = CurrentRoom.GetDoor(travelDirection).ConnectedRoom;
- fileName = Path.Combine(fileName, connectedRoom);
- fileName += ".room";
- CurrentRoom = (Room)CurrentRoom.Load(fileName);
+ CurrentRoom = (Room)CurrentRoom.Load(connectedRoom);
}
}
}
diff --git a/Mud Designer/MudEngine/GameCommands/CommandWalk.cs b/Mud Designer/MudEngine/GameCommands/CommandWalk.cs
index 2bebec8..8995888 100644
--- a/Mud Designer/MudEngine/GameCommands/CommandWalk.cs
+++ b/Mud Designer/MudEngine/GameCommands/CommandWalk.cs
@@ -33,23 +33,8 @@ namespace MudDesigner.MudEngine.GameCommands
if (door.TravelDirection == direction)
{
- string zonePath = "";
- string roomPath = "";
- string roomFilename = "";
+ room = (Room)room.Load(door.ConnectedRoom);
- if (room.Realm == "No Realm Associated.")
- {
- zonePath = FileManager.GetDataPath(SaveDataTypes.Zones);
- zonePath = Path.Combine(zonePath, room.Zone);
- }
- else
- {
- zonePath = FileManager.GetDataPath(room.Realm, room.Zone);
- }
-
- roomPath = Path.Combine(zonePath, "Rooms");
- roomFilename = Path.Combine(roomPath, door.ConnectedRoom + ".room");
- room = (Room)room.Load(roomFilename);
CommandResults cmd = CommandEngine.ExecuteCommand("Look", player, project, room, "Look");
string lookValue = "";
@@ -57,7 +42,6 @@ namespace MudDesigner.MudEngine.GameCommands
lookValue = cmd.Result[0].ToString();
return new CommandResults(new object[] { lookValue, room });
-
}
}
}
diff --git a/Mud Designer/MudEngine/GameManagement/GameScript.cs b/Mud Designer/MudEngine/GameManagement/GameScript.cs
index bae218d..c8e1a1d 100644
--- a/Mud Designer/MudEngine/GameManagement/GameScript.cs
+++ b/Mud Designer/MudEngine/GameManagement/GameScript.cs
@@ -7,9 +7,6 @@ using System.Text;
using MudDesigner.MudEngine.FileSystem;
using MudDesigner.MudEngine.GameManagement;
using MudDesigner.MudEngine.GameObjects;
-//ManagedScripting
-using ManagedScripting;
-using ManagedScripting.CodeBuilding;
namespace MudDesigner.MudEngine.GameManagement
{
diff --git a/Mud Designer/MudEngine/GameObjects/BaseObject.cs b/Mud Designer/MudEngine/GameObjects/BaseObject.cs
index ec2f914..a1c271c 100644
--- a/Mud Designer/MudEngine/GameObjects/BaseObject.cs
+++ b/Mud Designer/MudEngine/GameObjects/BaseObject.cs
@@ -100,7 +100,6 @@ namespace MudDesigner.MudEngine.GameObjects
private string _Name = "";
#endregion
- #region Constructor & Private Methods
///
/// Initializes the base object
///
@@ -114,7 +113,6 @@ namespace MudDesigner.MudEngine.GameObjects
this.Listen = "You hear nothing of interest.";
this.Smell = "You don't smell anything unsual.";
this.Name = DefaultName();
- SetupScript();
}
private bool ShouldSerializeName()
@@ -132,39 +130,13 @@ namespace MudDesigner.MudEngine.GameObjects
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;
- }
- }
- #endregion
-
#region Public Methods
///
/// Loads the supplied filename and returns it.
///
///
///
- public object Load(string filename)
+ public virtual object Load(string filename)
{
if (!File.Exists(filename))
{
diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Room.cs b/Mud Designer/MudEngine/GameObjects/Environment/Room.cs
index ef1570c..d52eb65 100644
--- a/Mud Designer/MudEngine/GameObjects/Environment/Room.cs
+++ b/Mud Designer/MudEngine/GameObjects/Environment/Room.cs
@@ -6,7 +6,9 @@ using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Drawing.Design;
+using System.IO;
+using MudDesigner.MudEngine.FileSystem;
using MudDesigner.MudEngine.UITypeEditors;
namespace MudDesigner.MudEngine.GameObjects.Environment
@@ -76,6 +78,26 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
set;
}
+ [Browsable(false)]
+ public string InstallPath
+ {
+ get
+ {
+ string zonePath = "";
+ if (this.Realm == null || this.Realm == "No Realm Associated.")
+ {
+ zonePath = FileManager.GetDataPath(SaveDataTypes.Zones);
+ zonePath = Path.Combine(zonePath, this.Zone);
+ }
+ else
+ zonePath = FileManager.GetDataPath(this.Realm, this.Zone);
+
+ string roomPath = Path.Combine(zonePath, "Rooms");
+ string filename = Path.Combine(roomPath, this.Filename);
+ return filename;
+ }
+ }
+
public Room()
{
Doorways = new List();
@@ -103,5 +125,63 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
}
return null;
}
+
+ ///
+ /// Load a Room that exists within the same Zone as the current Room
+ ///
+ ///
+ ///
+ public override object Load(string roomName)
+ {
+ //Correct the roomname incase it doesnt contain a file extension
+ if (!roomName.ToLower().EndsWith(".room"))
+ roomName += ".room";
+
+ //If the current room does not belong within a Realm, then load it from the
+ //Zones root directory
+ if (this.Realm != null || this.Realm != "No Realm Associated.")
+ {
+ return this.Load(roomName, this.Zone);
+ }
+ //This Zone is contained within a Realm so we have to load it from within the
+ //Realm and not from within the Zones root directory
+ else
+ return this.Load(roomName, this.Zone, this.Realm);
+ }
+
+ public object Load(string roomName, string zoneName)
+ {
+ string filename = "";
+ if (!roomName.ToLower().EndsWith(".room"))
+ roomName += ".room";
+
+ if (this.Realm != null && this.Realm != "No Realm Associated.")
+ {
+ return this.Load(roomName, zoneName, this.Realm);
+ }
+ else
+ filename = FileManager.GetDataPath(SaveDataTypes.Zones);
+
+ filename = Path.Combine(filename, zoneName);
+ filename = Path.Combine(filename, "Rooms");
+ filename = Path.Combine(filename, roomName);
+
+ return base.Load(filename);
+ }
+
+ public object Load(string roomName, string zoneName, string realmName)
+ {
+ if (!roomName.ToLower().EndsWith(".room"))
+ roomName += ".room";
+
+ string filename = FileManager.GetDataPath(realmName, zoneName);
+ filename = Path.Combine(filename, "Rooms");
+ filename = Path.Combine(filename, roomName);
+
+ if (realmName == null || realmName == "No Realm Associated.")
+ return this.Load(roomName, zoneName);
+
+ return base.Load(filename);
+ }
}
}
diff --git a/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs b/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs
index 322d72c..36de80b 100644
--- a/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs
+++ b/Mud Designer/MudEngine/GameObjects/Environment/Zone.cs
@@ -128,7 +128,8 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
foreach (string file in rooms)
{
Room r = new Room();
- r = (Room)FileManager.Load(file, r);
+ r = (Room)r.Load(Path.GetFileNameWithoutExtension(file));
+ //r = (Room)FileManager.Load(file, r);
this.Rooms.Add(r);
}
diff --git a/Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs b/Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs
index e525adf..a3ae44b 100644
--- a/Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs
+++ b/Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs
@@ -80,7 +80,7 @@ namespace MudDesigner.MudEngine.UITypeEditors
propertyDoorway.Refresh();
return;
}
- else if (_Room.DoorwayExist(e.ChangedItem.Value.ToString()))
+ else if (lstInstalledDoors.Items.Contains(e.ChangedItem.Value.ToString()))
{
MessageBox.Show("This direction has already been installed into the room. Please select another direction.", "Mud Designer");
_Door = (Door)propertyDoorway.SelectedObject;
@@ -88,6 +88,11 @@ namespace MudDesigner.MudEngine.UITypeEditors
propertyDoorway.Refresh();
return;
}
+ else
+ {
+ lstInstalledDoors.Items.Remove(e.OldValue.ToString());
+ lstInstalledDoors.Items.Add(e.ChangedItem.Value.ToString());
+ }
}
else if (e.ChangedItem.Label == "ConnectedRoom")
{
diff --git a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.Designer.cs b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.Designer.cs
index d546c60..b407a41 100644
--- a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.Designer.cs
+++ b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.Designer.cs
@@ -28,6 +28,7 @@
///
private void InitializeComponent()
{
+ this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UIRoomControl));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lstRooms = new System.Windows.Forms.ListBox();
@@ -37,9 +38,12 @@
this.txtFindRoom = new System.Windows.Forms.ToolStripTextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.propertyRoom = new System.Windows.Forms.PropertyGrid();
+ this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.mnuDeleteRoom = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
+ this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@@ -57,6 +61,7 @@
//
// lstRooms
//
+ this.lstRooms.ContextMenuStrip = this.contextMenuStrip1;
this.lstRooms.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstRooms.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lstRooms.FormattingEnabled = true;
@@ -124,6 +129,20 @@
this.propertyRoom.ToolbarVisible = false;
this.propertyRoom.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyRoom_PropertyValueChanged);
//
+ // contextMenuStrip1
+ //
+ this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.mnuDeleteRoom});
+ this.contextMenuStrip1.Name = "contextMenuStrip1";
+ this.contextMenuStrip1.Size = new System.Drawing.Size(143, 26);
+ //
+ // mnuDeleteRoom
+ //
+ this.mnuDeleteRoom.Name = "mnuDeleteRoom";
+ this.mnuDeleteRoom.Size = new System.Drawing.Size(152, 22);
+ this.mnuDeleteRoom.Text = "Delete Room";
+ this.mnuDeleteRoom.Click += new System.EventHandler(this.mnuDeleteRoom_Click);
+ //
// UIRoomControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -147,6 +166,7 @@
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.groupBox2.ResumeLayout(false);
+ this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -161,5 +181,7 @@
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.PropertyGrid propertyRoom;
public System.Windows.Forms.ListBox lstRooms;
+ private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem mnuDeleteRoom;
}
}
\ No newline at end of file
diff --git a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.cs b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.cs
index 8d9de48..08a3f92 100644
--- a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.cs
+++ b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.cs
@@ -145,8 +145,7 @@ namespace MudDesigner.MudEngine.UITypeEditors
{
//Load the connected room
Room r = new Room();
- fullFilename = Path.Combine(savePath, d.ConnectedRoom + ".room");
- r = (Room)r.Load(fullFilename);
+ r = (Room)r.Load(d.ConnectedRoom);
//Loop though each of its doorways to see if any of them are attached
//to are old room name
foreach (Door renamedDoor in r.Doorways)
@@ -211,7 +210,7 @@ namespace MudDesigner.MudEngine.UITypeEditors
zoneRoomPath = Path.Combine(zonePath, "Rooms");
roomFile = Path.Combine(zoneRoomPath, roomName);
_Room = new Room();
- _Room = (Room)_Room.Load(roomFile);
+ _Room = (Room)_Room.Load(roomName, _Zone.Name, _Zone.Realm);
propertyRoom.SelectedObject = _Room;
}
@@ -220,5 +219,20 @@ namespace MudDesigner.MudEngine.UITypeEditors
if (!CheckSavedState())
e.Cancel = true;
}
+
+ private void mnuDeleteRoom_Click(object sender, EventArgs e)
+ {
+ if (lstRooms.SelectedIndex == -1)
+ {
+ MessageBox.Show("Select a Room to delete first!", "Mud Designer");
+ return;
+ }
+
+ Room r = new Room();
+ r = (Room)r.Load(lstRooms.SelectedItem.ToString(), _Zone.Name);
+ File.Delete(r.InstallPath);
+ lstRooms.Items.Remove(lstRooms.SelectedItem);
+ _Zone.Rooms.Remove(r);
+ }
}
}
diff --git a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.resx b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.resx
index ffe8b9e..e283f09 100644
--- a/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.resx
+++ b/Mud Designer/MudEngine/UITypeEditors/UIRoomControl.resx
@@ -117,6 +117,9 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 122, 17
+
17, 17
diff --git a/Mud Designer/Program.cs b/Mud Designer/Program.cs
index f7294cd..31e06ed 100644
--- a/Mud Designer/Program.cs
+++ b/Mud Designer/Program.cs
@@ -10,9 +10,6 @@ using MudDesigner.MudEngine.FileSystem;
using MudDesigner.MudEngine.GameManagement;
using MudDesigner.MudEngine.GameObjects;
using MudDesigner.MudEngine.GameObjects.Environment;
-//Script Engine
-using ManagedScripting;
-using ManagedScripting.CodeBuilding;
namespace MudDesigner
{
diff --git a/Mud Designer/Runtime.cs b/Mud Designer/Runtime.cs
index 92a6235..21a8bc0 100644
--- a/Mud Designer/Runtime.cs
+++ b/Mud Designer/Runtime.cs
@@ -66,8 +66,17 @@ namespace MudDesigner
}
public void Print(string message)
{
+ if (string.IsNullOrEmpty(message))
+ return;
+
txtConsole.Text += message + "\n";
- txtConsole.Select(txtConsole.Text.Length, 0);
+ txtConsole.Select(txtConsole.Text.Length - 1, 0);
+ }
+
+ public void Print(bool newLine)
+ {
+ txtCommand.Text += "\n";
+ txtConsole.Select(txtConsole.Text.Length - 1, 0);
}
private void Runtime_Load(object sender, EventArgs e)
@@ -79,36 +88,24 @@ namespace MudDesigner
return;
}
_Project = (ProjectInformation)_Project.Load(FileManager.GetDataPath(SaveDataTypes.Root));
- if ((_Project.InitialLocation.Zone == null) || (_Project.InitialLocation.Zone == ""))
+ if (_Project.InitialLocation.Zone == null && _Project.InitialLocation.Zone == "")
{
Print("No Initial Zone was defined within the Project Information. Please associated a Zone to the Projects Initial Zone setting in order to launch the game.");
return;
}
Print("Loading environment...");
- string filename = FileManager.GetDataPath(SaveDataTypes.Root);
- if (!String.IsNullOrEmpty(_Project.InitialLocation.Realm) && (_Project.InitialLocation.Realm != "No Realm Associated."))
- {
- filename = Path.Combine(filename, "Realms");
- filename = Path.Combine(filename, _Project.InitialLocation.Realm);
- }
- filename = Path.Combine(filename, "Zones");
- filename = Path.Combine(filename, _Project.InitialLocation.Zone);
- filename = Path.Combine(filename, "Rooms");
- filename = Path.Combine(filename, _Project.InitialLocation.Room);
- filename += ".room";
- _Room = (Room)_Room.Load(filename);
+ _Room = (Room)_Room.Load(_Project.InitialLocation.Room, _Project.InitialLocation.Zone);
Print("Prepping test player...");
_Player.CurrentRoom = _Room;
- _Player.OnTravel(AvailableTravelDirections.North);
Print("Loading Game Commands...");
CommandEngine.LoadAllCommands();
Print("Startup Complete.");
- Print(""); //blank line
+ Print(true); //blank line
txtCommand.Select();
if (string.IsNullOrEmpty(_Project.CompanyName))
@@ -136,7 +133,7 @@ namespace MudDesigner
else
Print(_Project.Story);
- Print("");//blank line
+ Print(true);//blank line
ExecuteCommand("Look");
}