Designer:
- Designer now has a status bar to show when various things are completed successfully. - The Offline Runtime can now be launched via the Designers Project menu. - Designer now features a 'Set As Initial Location' item within the Right-Click menu. Right Click on a Zone and assign it as your projects initial starting location. Engine: - BaseCharacter class fleshed out a little bit. Now includes an OnTravel method for player travel code. - PlayerBasic class now inherits from BaseCharacter. - ProjectInformation now supports setting the games initial zone location. - ProjectInformation.Filename is now placed within a category (Object Settings) within the Property Pane of the Designer. - Room.GetDoor method added for returning a specified door with the matching travel direction. - StartingLocation now overrides ToString to return the location that's currently assigned to it for use within the Designer. - Zone class now has an EntranceRoom Property for settings the default entrance room for the Zone. This is used by the Runtime and the designer when setting and retrieving the InitialLocation. Offline Runtime: - Now creates a basic player, loads the project and places the player within the entrance room designated by the InitialLocation.Zone - Runtime contains code that automatically moves the player to the north during startup. This will be removed, it's only there for testing purposes. - Runtime does not print anything to the console yet.
This commit is contained in:
parent
2ec31c0170
commit
efc49e35ce
12 changed files with 233 additions and 37 deletions
73
Mud Designer/Designer.Designer.cs
generated
73
Mud Designer/Designer.Designer.cs
generated
|
@ -29,7 +29,7 @@
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Project");
|
||||
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Project");
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Designer));
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.mnuFile = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -71,6 +71,8 @@
|
|||
this.mnuHelp = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.containerMain = new System.Windows.Forms.SplitContainer();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.lblStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.containerSidebar = new System.Windows.Forms.SplitContainer();
|
||||
this.treeExplorer = new System.Windows.Forms.TreeView();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
|
@ -81,6 +83,8 @@
|
|||
this.mnuEditObject = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.mnuDeleteSelectedObject = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.setAsInitialLocationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.btnRefreshObjects = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
|
@ -91,8 +95,10 @@
|
|||
this.lblObjectProperties = new System.Windows.Forms.Label();
|
||||
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.containerMain.Panel1.SuspendLayout();
|
||||
this.containerMain.Panel2.SuspendLayout();
|
||||
this.containerMain.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.containerSidebar.Panel1.SuspendLayout();
|
||||
this.containerSidebar.Panel2.SuspendLayout();
|
||||
this.containerSidebar.SuspendLayout();
|
||||
|
@ -356,7 +362,6 @@
|
|||
this.freshLoginToolStripMenuItem,
|
||||
this.customCharacterToolStripMenuItem,
|
||||
this.playFromCurrentRoomToolStripMenuItem});
|
||||
this.testProjectToolStripMenuItem.Enabled = false;
|
||||
this.testProjectToolStripMenuItem.Name = "testProjectToolStripMenuItem";
|
||||
this.testProjectToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
|
||||
this.testProjectToolStripMenuItem.Text = "Test Project";
|
||||
|
@ -366,15 +371,18 @@
|
|||
this.freshLoginToolStripMenuItem.Name = "freshLoginToolStripMenuItem";
|
||||
this.freshLoginToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
|
||||
this.freshLoginToolStripMenuItem.Text = "Fresh Login";
|
||||
this.freshLoginToolStripMenuItem.Click += new System.EventHandler(this.freshLoginToolStripMenuItem_Click);
|
||||
//
|
||||
// customCharacterToolStripMenuItem
|
||||
//
|
||||
this.customCharacterToolStripMenuItem.Enabled = false;
|
||||
this.customCharacterToolStripMenuItem.Name = "customCharacterToolStripMenuItem";
|
||||
this.customCharacterToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
|
||||
this.customCharacterToolStripMenuItem.Text = "Custom Character";
|
||||
//
|
||||
// playFromCurrentRoomToolStripMenuItem
|
||||
//
|
||||
this.playFromCurrentRoomToolStripMenuItem.Enabled = false;
|
||||
this.playFromCurrentRoomToolStripMenuItem.Name = "playFromCurrentRoomToolStripMenuItem";
|
||||
this.playFromCurrentRoomToolStripMenuItem.Size = new System.Drawing.Size(205, 22);
|
||||
this.playFromCurrentRoomToolStripMenuItem.Text = "Play From Current Room";
|
||||
|
@ -401,6 +409,10 @@
|
|||
this.containerMain.Location = new System.Drawing.Point(0, 24);
|
||||
this.containerMain.Name = "containerMain";
|
||||
//
|
||||
// containerMain.Panel1
|
||||
//
|
||||
this.containerMain.Panel1.Controls.Add(this.statusStrip1);
|
||||
//
|
||||
// containerMain.Panel2
|
||||
//
|
||||
this.containerMain.Panel2.Controls.Add(this.containerSidebar);
|
||||
|
@ -408,6 +420,23 @@
|
|||
this.containerMain.SplitterDistance = 511;
|
||||
this.containerMain.TabIndex = 1;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lblStatus});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 518);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(511, 22);
|
||||
this.statusStrip1.TabIndex = 4;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.ForeColor = System.Drawing.Color.Silver;
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(109, 17);
|
||||
this.lblStatus.Text = "Nothing To Report.";
|
||||
//
|
||||
// containerSidebar
|
||||
//
|
||||
this.containerSidebar.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
|
@ -436,10 +465,10 @@
|
|||
this.treeExplorer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.treeExplorer.Location = new System.Drawing.Point(0, 38);
|
||||
this.treeExplorer.Name = "treeExplorer";
|
||||
treeNode1.Name = "nodeProject";
|
||||
treeNode1.Text = "Project";
|
||||
treeNode2.Name = "nodeProject";
|
||||
treeNode2.Text = "Project";
|
||||
this.treeExplorer.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
|
||||
treeNode1});
|
||||
treeNode2});
|
||||
this.treeExplorer.Size = new System.Drawing.Size(267, 204);
|
||||
this.treeExplorer.TabIndex = 5;
|
||||
this.toolTip1.SetToolTip(this.treeExplorer, resources.GetString("treeExplorer.ToolTip"));
|
||||
|
@ -451,16 +480,18 @@
|
|||
this.addObjectToolStripMenuItem,
|
||||
this.mnuEditObject,
|
||||
this.toolStripMenuItem1,
|
||||
this.mnuDeleteSelectedObject});
|
||||
this.mnuDeleteSelectedObject,
|
||||
this.toolStripMenuItem7,
|
||||
this.setAsInitialLocationToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(146, 76);
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(188, 104);
|
||||
//
|
||||
// addObjectToolStripMenuItem
|
||||
//
|
||||
this.addObjectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.environmentToolStripMenuItem});
|
||||
this.addObjectToolStripMenuItem.Name = "addObjectToolStripMenuItem";
|
||||
this.addObjectToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
|
||||
this.addObjectToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
|
||||
this.addObjectToolStripMenuItem.Text = "Add Object";
|
||||
//
|
||||
// environmentToolStripMenuItem
|
||||
|
@ -489,22 +520,34 @@
|
|||
// mnuEditObject
|
||||
//
|
||||
this.mnuEditObject.Name = "mnuEditObject";
|
||||
this.mnuEditObject.Size = new System.Drawing.Size(145, 22);
|
||||
this.mnuEditObject.Size = new System.Drawing.Size(187, 22);
|
||||
this.mnuEditObject.Text = "Edit Object";
|
||||
this.mnuEditObject.Click += new System.EventHandler(this.mnuEditObject_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(142, 6);
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(184, 6);
|
||||
//
|
||||
// mnuDeleteSelectedObject
|
||||
//
|
||||
this.mnuDeleteSelectedObject.Name = "mnuDeleteSelectedObject";
|
||||
this.mnuDeleteSelectedObject.Size = new System.Drawing.Size(145, 22);
|
||||
this.mnuDeleteSelectedObject.Size = new System.Drawing.Size(187, 22);
|
||||
this.mnuDeleteSelectedObject.Text = "Delete Object";
|
||||
this.mnuDeleteSelectedObject.Click += new System.EventHandler(this.mnuDeleteSelectedObject_Click);
|
||||
//
|
||||
// toolStripMenuItem7
|
||||
//
|
||||
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
|
||||
this.toolStripMenuItem7.Size = new System.Drawing.Size(184, 6);
|
||||
//
|
||||
// setAsInitialLocationToolStripMenuItem
|
||||
//
|
||||
this.setAsInitialLocationToolStripMenuItem.Name = "setAsInitialLocationToolStripMenuItem";
|
||||
this.setAsInitialLocationToolStripMenuItem.Size = new System.Drawing.Size(187, 22);
|
||||
this.setAsInitialLocationToolStripMenuItem.Text = "Set As Initial Location";
|
||||
this.setAsInitialLocationToolStripMenuItem.Click += new System.EventHandler(this.setAsInitialLocationToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -606,8 +649,12 @@
|
|||
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.containerMain.Panel1.ResumeLayout(false);
|
||||
this.containerMain.Panel1.PerformLayout();
|
||||
this.containerMain.Panel2.ResumeLayout(false);
|
||||
this.containerMain.ResumeLayout(false);
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
this.statusStrip1.PerformLayout();
|
||||
this.containerSidebar.Panel1.ResumeLayout(false);
|
||||
this.containerSidebar.Panel1.PerformLayout();
|
||||
this.containerSidebar.Panel2.ResumeLayout(false);
|
||||
|
@ -681,6 +728,10 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem environmentToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuNewRealmShortcut;
|
||||
private System.Windows.Forms.ToolStripMenuItem mnuNewZoneShortcut;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem7;
|
||||
private System.Windows.Forms.ToolStripMenuItem setAsInitialLocationToolStripMenuItem;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel lblStatus;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ namespace MudDesigner
|
|||
break;
|
||||
case "Currencies":
|
||||
return ObjectType.Currency;
|
||||
case "Rooms":
|
||||
return ObjectType.Room;
|
||||
case "Realms":
|
||||
return ObjectType.Realm;
|
||||
case "Zones":
|
||||
|
@ -392,6 +394,11 @@ namespace MudDesigner
|
|||
}
|
||||
}
|
||||
|
||||
private void SetStatus(string status)
|
||||
{
|
||||
lblStatus.Text = "Status: " + status;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the Project Explorer incase the directory structure
|
||||
/// has changed, but was not reflected in the Explorer
|
||||
|
@ -588,5 +595,47 @@ namespace MudDesigner
|
|||
if (e.KeyCode == Keys.Enter)
|
||||
FindObject(txtSearch.Text);
|
||||
}
|
||||
|
||||
private void setAsInitialLocationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (GetNodeType(treeExplorer.SelectedNode) == ObjectType.ZoneRoot)
|
||||
{
|
||||
StartingLocation location = new StartingLocation();
|
||||
|
||||
Zone zone = new Zone();
|
||||
string filename = "";
|
||||
if (Path.GetExtension(treeExplorer.SelectedNode.FullPath) == "")
|
||||
{
|
||||
filename = treeExplorer.SelectedNode.Text + ".zone";
|
||||
}
|
||||
else
|
||||
filename = treeExplorer.SelectedNode.Text;
|
||||
|
||||
string path = Path.Combine(FileManager.GetDataPath(SaveDataTypes.Zones), Path.GetFileNameWithoutExtension(filename));
|
||||
path = Path.Combine(path, filename);
|
||||
zone = (Zone)zone.Load(path);
|
||||
|
||||
location.Realm = "No Realm Associated.";
|
||||
location.Zone = zone.Name;
|
||||
location.Room = zone.EntranceRoom;
|
||||
_Project.InitialLocation = location;
|
||||
_Project.Save(Path.Combine(FileManager.GetDataPath(SaveDataTypes.Root), "Game.xml"));
|
||||
SetStatus("Location Assigned successfully.");
|
||||
}
|
||||
|
||||
else
|
||||
MessageBox.Show("You must select a Zone File when you set the Initial Location", "Mud Designer");
|
||||
}
|
||||
|
||||
private void freshLoginToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Runtime form = new Runtime();
|
||||
form.Show();
|
||||
this.Hide();
|
||||
while (form.Created)
|
||||
Application.DoEvents();
|
||||
|
||||
this.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,9 @@
|
|||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>19, 12</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>603, 17</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>128, 15</value>
|
||||
</metadata>
|
||||
|
@ -136,6 +139,11 @@
|
|||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>382, 17</value>
|
||||
</metadata>
|
||||
<data name="propertyObject.ToolTip" xml:space="preserve">
|
||||
<value>The properties of the currently loaded object are editable with the Object Properties window. Object changes are automatically saved.
|
||||
|
||||
Note that new objects are not saved until their Name value is changed.</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnRefreshObjects.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
@ -151,11 +159,6 @@
|
|||
NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
|
||||
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="propertyObject.ToolTip" xml:space="preserve">
|
||||
<value>The properties of the currently loaded object are editable with the Object Properties window. Object changes are automatically saved.
|
||||
|
||||
Note that new objects are not saved until their Name value is changed.</value>
|
||||
</data>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>42</value>
|
||||
|
|
|
@ -2,13 +2,41 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
using MudDesigner.MudEngine.Interfaces;
|
||||
using MudDesigner.MudEngine.GameObjects;
|
||||
using MudDesigner.MudEngine.FileSystem;
|
||||
using MudDesigner.MudEngine.GameCommands;
|
||||
using MudDesigner.MudEngine.GameManagement;
|
||||
using MudDesigner.MudEngine.GameObjects.Environment;
|
||||
using MudDesigner.MudEngine.GameObjects.Items;
|
||||
|
||||
namespace MudDesigner.MudEngine.Characters
|
||||
{
|
||||
public class BaseCharacter : BaseObject
|
||||
{
|
||||
public Room CurrentRoom { get; set; }
|
||||
|
||||
public virtual void OnTravel(AvailableTravelDirections travelDirection)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
|||
|
||||
namespace MudDesigner.MudEngine.Characters.Controlled
|
||||
{
|
||||
public class PlayerBasic
|
||||
public class PlayerBasic : BaseCharacter
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace MudDesigner.MudEngine.GameManagement
|
|||
{
|
||||
public class GameScript
|
||||
{
|
||||
ScriptObject _ScriptObject;
|
||||
|
||||
public GameScript()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -112,12 +112,9 @@ namespace MudDesigner.MudEngine.GameManagement
|
|||
[Browsable(false)]
|
||||
public string ProjectPath { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public StartingLocation InitialLocation
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Category("Environment Settings")]
|
||||
[ReadOnly(true)]
|
||||
public StartingLocation InitialLocation { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
public string Story
|
||||
|
@ -126,6 +123,7 @@ namespace MudDesigner.MudEngine.GameManagement
|
|||
set;
|
||||
}
|
||||
|
||||
[Category("Object Setup")]
|
||||
public string Filename
|
||||
{
|
||||
get
|
||||
|
@ -142,6 +140,7 @@ namespace MudDesigner.MudEngine.GameManagement
|
|||
_Filename = "Game.xml";
|
||||
BaseCurrencyAmount = 1;
|
||||
BaseCurrencyName = "Copper";
|
||||
InitialLocation = new StartingLocation();
|
||||
}
|
||||
|
||||
public void Save(string filename)
|
||||
|
|
|
@ -93,5 +93,15 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Door GetDoor(AvailableTravelDirections travelDirection)
|
||||
{
|
||||
foreach (Door door in this.Doorways)
|
||||
{
|
||||
if (door.TravelDirection == travelDirection)
|
||||
return door;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,5 +10,23 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
public string Room;
|
||||
public string Zone;
|
||||
public string Realm;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Room))
|
||||
return "No initial location defined.";
|
||||
else
|
||||
{
|
||||
if (Realm == "No Realm Associated.")
|
||||
{
|
||||
return Zone + "->" + Room;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Realm + "->" + Zone + "->" + Room;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,6 +57,9 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
[Description("Collection of Rooms that have been created. Editing the Rooms Collection lets you manage the Zones rooms.")]
|
||||
public List<Room> Rooms { get; set; }
|
||||
|
||||
[Category("Environment Information")]
|
||||
public string EntranceRoom { get; set; }
|
||||
|
||||
public Zone()
|
||||
{
|
||||
Rooms = new List<Room>();
|
||||
|
|
21
Mud Designer/Runtime.Designer.cs
generated
21
Mud Designer/Runtime.Designer.cs
generated
|
@ -29,8 +29,8 @@
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.txtCommand = new System.Windows.Forms.TextBox();
|
||||
this.txtConsole = new System.Windows.Forms.RichTextBox();
|
||||
this.txtCommand = new System.Windows.Forms.TextBox();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
|
@ -55,15 +55,6 @@
|
|||
this.splitContainer1.SplitterDistance = 393;
|
||||
this.splitContainer1.TabIndex = 0;
|
||||
//
|
||||
// txtCommand
|
||||
//
|
||||
this.txtCommand.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtCommand.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtCommand.Name = "txtCommand";
|
||||
this.txtCommand.Size = new System.Drawing.Size(693, 20);
|
||||
this.txtCommand.TabIndex = 1;
|
||||
this.txtCommand.TextChanged += new System.EventHandler(this.txtCommand_TextChanged);
|
||||
//
|
||||
// txtConsole
|
||||
//
|
||||
this.txtConsole.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
|
@ -73,6 +64,15 @@
|
|||
this.txtConsole.TabIndex = 0;
|
||||
this.txtConsole.Text = "";
|
||||
//
|
||||
// txtCommand
|
||||
//
|
||||
this.txtCommand.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtCommand.Location = new System.Drawing.Point(0, 0);
|
||||
this.txtCommand.Name = "txtCommand";
|
||||
this.txtCommand.Size = new System.Drawing.Size(693, 20);
|
||||
this.txtCommand.TabIndex = 1;
|
||||
this.txtCommand.TextChanged += new System.EventHandler(this.txtCommand_TextChanged);
|
||||
//
|
||||
// Runtime
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -81,6 +81,7 @@
|
|||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "Runtime";
|
||||
this.Text = "Runtime";
|
||||
this.Load += new System.EventHandler(this.Runtime_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.PerformLayout();
|
||||
|
|
|
@ -10,6 +10,9 @@ using System.Text;
|
|||
using System.Windows.Forms;
|
||||
|
||||
//Mud Designer
|
||||
using MudDesigner.MudEngine.Characters;
|
||||
using MudDesigner.MudEngine.Characters.Controlled;
|
||||
using MudDesigner.MudEngine.Characters.NPC;
|
||||
using MudDesigner.MudEngine.GameCommands;
|
||||
using MudDesigner.MudEngine.FileSystem;
|
||||
using MudDesigner.MudEngine.GameManagement;
|
||||
|
@ -21,15 +24,48 @@ namespace MudDesigner
|
|||
{
|
||||
public partial class Runtime : Form
|
||||
{
|
||||
|
||||
PlayerBasic _Player;
|
||||
Room _Room;
|
||||
ProjectInformation _Project;
|
||||
|
||||
public Runtime()
|
||||
{
|
||||
InitializeComponent();
|
||||
_Player = new PlayerBasic();
|
||||
_Project = new ProjectInformation();
|
||||
_Room = new Room();
|
||||
}
|
||||
|
||||
private void Runtime_Load(object sender, EventArgs e)
|
||||
{
|
||||
_Project = (ProjectInformation)_Project.Load(FileManager.GetDataPath(SaveDataTypes.Root));
|
||||
if (_Project.InitialLocation.Zone == "")
|
||||
{
|
||||
MessageBox.Show("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.",
|
||||
"Mud Designer", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
string filename = FileManager.GetDataPath(SaveDataTypes.Root);
|
||||
if (_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);
|
||||
_Player.CurrentRoom = _Room;
|
||||
_Player.OnTravel(AvailableTravelDirections.North);
|
||||
}
|
||||
|
||||
private void txtCommand_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue