- Room Linking development started
- Code Optimizations - Room Editor UI Tweaking - Doorway Editor added - Room Interface added. - Rooms now contain a Realm Property so that users can easily figure out what Realm a designated Room belongs to.
This commit is contained in:
parent
6c8678a624
commit
2a88141b02
10 changed files with 517 additions and 27 deletions
|
@ -88,10 +88,18 @@
|
|||
<Compile Include="MudEngine\Interfaces\IFileIO.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IGameObject.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IQuest.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IRoom.cs" />
|
||||
<Compile Include="MudEngine\Interfaces\IRuleSet.cs" />
|
||||
<Compile Include="MudEngine\GameManagement\ProjectInformation.cs" />
|
||||
<Compile Include="MudEngine\FileSystem\FileManager.cs" />
|
||||
<Compile Include="MudEngine\GameManagement\QuestSetup.cs" />
|
||||
<Compile Include="MudEngine\UITypeEditors\UIDoorwayControl.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MudEngine\UITypeEditors\UIDoorwayControl.Designer.cs">
|
||||
<DependentUpon>UIDoorwayControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MudEngine\UITypeEditors\UIDoorwayEditor.cs" />
|
||||
<Compile Include="MudEngine\UITypeEditors\UIRealmControl.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -118,6 +126,10 @@
|
|||
<DependentUpon>Designer.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MudEngine\UITypeEditors\UIDoorwayControl.resx">
|
||||
<DependentUpon>UIDoorwayControl.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MudEngine\UITypeEditors\UIRealmControl.resx">
|
||||
<DependentUpon>UIRealmControl.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
@ -5,17 +5,28 @@ using System.Text;
|
|||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
using MudDesigner.MudEngine.UITypeEditors;
|
||||
using MudDesigner.MudEngine.GameObjects.Items;
|
||||
|
||||
namespace MudDesigner.MudEngine.GameObjects.Environment
|
||||
{
|
||||
[XmlInclude(typeof(ConnectedRoom))]
|
||||
[XmlInclude(typeof(BaseItem))]
|
||||
[Serializable]
|
||||
public class Door
|
||||
{
|
||||
public struct ConnectedRoom
|
||||
public struct DoorwayLinkInformation
|
||||
{
|
||||
public string Realm;
|
||||
public string Zone;
|
||||
public string Room;
|
||||
public AvailableTravelDirections TravelDirection;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Room))
|
||||
return "Doorway to no where.";
|
||||
else
|
||||
return "Doorway to " + Room;
|
||||
}
|
||||
}
|
||||
|
||||
[Category("Door Settings")]
|
||||
|
@ -27,7 +38,8 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
}
|
||||
|
||||
[Category("Door Settings")]
|
||||
public string RequiredKey
|
||||
[Browsable(false)]
|
||||
public BaseItem RequiredKey
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
@ -41,28 +53,33 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
set;
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public AvailableTravelDirections TravelDirection
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[ReadOnly(true)]
|
||||
[Category("Door Settings")]
|
||||
public ConnectedRoom TravelRoom
|
||||
[EditorAttribute(typeof(UIDoorwayEditor), typeof(System.Drawing.Design.UITypeEditor))]
|
||||
public DoorwayLinkInformation DoorwayLink
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Door(AvailableTravelDirections TravelDirection)
|
||||
{
|
||||
this.TravelDirection = TravelDirection;
|
||||
}
|
||||
[Browsable(false)]
|
||||
public AvailableTravelDirections TravelDirection;
|
||||
|
||||
public Door()
|
||||
{
|
||||
LevelRequirement = 0;
|
||||
IsLocked = false;
|
||||
RequiredKey = new BaseItem();
|
||||
DoorwayLink = new DoorwayLinkInformation();
|
||||
}
|
||||
|
||||
public Door(DoorwayLinkInformation linkInformation) : this()
|
||||
{
|
||||
this.DoorwayLink = linkInformation;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.TravelDirection.ToString() + " Doorway";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,23 +8,24 @@ using System.Xml.Serialization;
|
|||
|
||||
namespace MudDesigner.MudEngine.GameObjects.Environment
|
||||
{
|
||||
[XmlInclude(typeof(Door))]
|
||||
public class Room : BaseObject
|
||||
{
|
||||
[Category("Environment Information")]
|
||||
[Description("Shows what rooms are currently created and linked to within this Room.")]
|
||||
[ReadOnly(true)]
|
||||
public string DoorList
|
||||
public string InstalledDoorways
|
||||
{
|
||||
get
|
||||
{
|
||||
string installed = "";
|
||||
if (this.InstalledDoors.Count != 0)
|
||||
if (this.Doorways.Count != 0)
|
||||
{
|
||||
foreach (Door d in InstalledDoors)
|
||||
foreach (Door d in Doorways)
|
||||
{
|
||||
installed += d.TravelDirection.ToString() + ",";
|
||||
}
|
||||
if (InstalledDoors.Count >= 2)
|
||||
if (Doorways.Count >= 2)
|
||||
{
|
||||
installed = installed.Substring(0, installed.Length - 1);
|
||||
}
|
||||
|
@ -37,7 +38,11 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
|
||||
[Category("Environment Information")]
|
||||
[Description("Allows for linking of Rooms together via Doorways")]
|
||||
public List<Door> InstalledDoors;
|
||||
public List<Door> Doorways
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[ReadOnly(true)]
|
||||
[Description("This is the Zone that the Room is currently assigned to.")]
|
||||
|
@ -48,6 +53,15 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
set;
|
||||
}
|
||||
|
||||
[ReadOnly(true)]
|
||||
[Description("This is the Realm that the Room belongs to.")]
|
||||
[Category("Environment Information")]
|
||||
public string Realm
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Category("Environment Information")]
|
||||
[DefaultValue(false)]
|
||||
[Description("Determins if the Player can be attacked within this Room or not.")]
|
||||
|
@ -60,7 +74,7 @@ namespace MudDesigner.MudEngine.GameObjects.Environment
|
|||
public Room TestRoom { get; set; }
|
||||
public Room()
|
||||
{
|
||||
InstalledDoors = new List<Door>();
|
||||
Doorways = new List<Door>();
|
||||
IsSafe = false;
|
||||
}
|
||||
}
|
||||
|
|
11
Mud Designer/MudEngine/Interfaces/IRoom.cs
Normal file
11
Mud Designer/MudEngine/Interfaces/IRoom.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MudDesigner.MudEngine.Interfaces
|
||||
{
|
||||
public interface IRoom : IGameObject
|
||||
{
|
||||
}
|
||||
}
|
247
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.Designer.cs
generated
Normal file
247
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.Designer.cs
generated
Normal file
|
@ -0,0 +1,247 @@
|
|||
namespace MudDesigner.MudEngine.UITypeEditors
|
||||
{
|
||||
partial class UIDoorwayControl
|
||||
{
|
||||
/// <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 Component 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.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.btnUp = new System.Windows.Forms.Button();
|
||||
this.btnDown = new System.Windows.Forms.Button();
|
||||
this.btnWest = new System.Windows.Forms.Button();
|
||||
this.btnNorth = new System.Windows.Forms.Button();
|
||||
this.btnSouth = new System.Windows.Forms.Button();
|
||||
this.btnEast = new System.Windows.Forms.Button();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.lstRooms = new System.Windows.Forms.ListBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.lblDoorway = new System.Windows.Forms.Label();
|
||||
this.propertyDoor = new System.Windows.Forms.PropertyGrid();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.btnUp);
|
||||
this.groupBox1.Controls.Add(this.btnDown);
|
||||
this.groupBox1.Controls.Add(this.btnWest);
|
||||
this.groupBox1.Controls.Add(this.btnNorth);
|
||||
this.groupBox1.Controls.Add(this.btnSouth);
|
||||
this.groupBox1.Controls.Add(this.btnEast);
|
||||
this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.groupBox1.ForeColor = System.Drawing.Color.Silver;
|
||||
this.groupBox1.Location = new System.Drawing.Point(263, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(321, 225);
|
||||
this.groupBox1.TabIndex = 2;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Available Travel Directions";
|
||||
//
|
||||
// btnUp
|
||||
//
|
||||
this.btnUp.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnUp.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnUp.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnUp.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnUp.Location = new System.Drawing.Point(11, 171);
|
||||
this.btnUp.Name = "btnUp";
|
||||
this.btnUp.Size = new System.Drawing.Size(97, 47);
|
||||
this.btnUp.TabIndex = 8;
|
||||
this.btnUp.Text = "Up";
|
||||
this.btnUp.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// btnDown
|
||||
//
|
||||
this.btnDown.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnDown.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnDown.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnDown.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnDown.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnDown.Location = new System.Drawing.Point(217, 171);
|
||||
this.btnDown.Name = "btnDown";
|
||||
this.btnDown.Size = new System.Drawing.Size(97, 47);
|
||||
this.btnDown.TabIndex = 7;
|
||||
this.btnDown.Text = "Down";
|
||||
this.btnDown.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// btnWest
|
||||
//
|
||||
this.btnWest.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnWest.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnWest.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnWest.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnWest.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnWest.Location = new System.Drawing.Point(11, 66);
|
||||
this.btnWest.Name = "btnWest";
|
||||
this.btnWest.Size = new System.Drawing.Size(97, 73);
|
||||
this.btnWest.TabIndex = 6;
|
||||
this.btnWest.Text = "West";
|
||||
this.btnWest.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// btnNorth
|
||||
//
|
||||
this.btnNorth.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnNorth.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnNorth.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnNorth.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnNorth.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnNorth.Location = new System.Drawing.Point(114, 19);
|
||||
this.btnNorth.Name = "btnNorth";
|
||||
this.btnNorth.Size = new System.Drawing.Size(97, 73);
|
||||
this.btnNorth.TabIndex = 5;
|
||||
this.btnNorth.Text = "North";
|
||||
this.btnNorth.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// btnSouth
|
||||
//
|
||||
this.btnSouth.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnSouth.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnSouth.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnSouth.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnSouth.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnSouth.Location = new System.Drawing.Point(114, 98);
|
||||
this.btnSouth.Name = "btnSouth";
|
||||
this.btnSouth.Size = new System.Drawing.Size(97, 73);
|
||||
this.btnSouth.TabIndex = 4;
|
||||
this.btnSouth.Text = "South";
|
||||
this.btnSouth.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// btnEast
|
||||
//
|
||||
this.btnEast.BackColor = System.Drawing.Color.Gray;
|
||||
this.btnEast.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Silver;
|
||||
this.btnEast.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Silver;
|
||||
this.btnEast.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnEast.ForeColor = System.Drawing.Color.Black;
|
||||
this.btnEast.Location = new System.Drawing.Point(217, 66);
|
||||
this.btnEast.Name = "btnEast";
|
||||
this.btnEast.Size = new System.Drawing.Size(97, 73);
|
||||
this.btnEast.TabIndex = 3;
|
||||
this.btnEast.Text = "East";
|
||||
this.btnEast.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.lstRooms);
|
||||
this.groupBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.groupBox3.ForeColor = System.Drawing.Color.Silver;
|
||||
this.groupBox3.Location = new System.Drawing.Point(3, 12);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(254, 402);
|
||||
this.groupBox3.TabIndex = 11;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Available Rooms";
|
||||
//
|
||||
// lstRooms
|
||||
//
|
||||
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;
|
||||
this.lstRooms.Location = new System.Drawing.Point(3, 16);
|
||||
this.lstRooms.Name = "lstRooms";
|
||||
this.lstRooms.Size = new System.Drawing.Size(248, 381);
|
||||
this.lstRooms.TabIndex = 0;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.propertyDoor);
|
||||
this.groupBox2.Controls.Add(this.lblDoorway);
|
||||
this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.groupBox2.ForeColor = System.Drawing.Color.Silver;
|
||||
this.groupBox2.Location = new System.Drawing.Point(263, 243);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(321, 171);
|
||||
this.groupBox2.TabIndex = 12;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Doorway Properties";
|
||||
//
|
||||
// lblDoorway
|
||||
//
|
||||
this.lblDoorway.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.lblDoorway.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblDoorway.ForeColor = System.Drawing.Color.Gray;
|
||||
this.lblDoorway.Location = new System.Drawing.Point(3, 16);
|
||||
this.lblDoorway.Name = "lblDoorway";
|
||||
this.lblDoorway.Padding = new System.Windows.Forms.Padding(0, 0, 0, 1);
|
||||
this.lblDoorway.Size = new System.Drawing.Size(315, 13);
|
||||
this.lblDoorway.TabIndex = 0;
|
||||
this.lblDoorway.Text = "Doorway:";
|
||||
this.lblDoorway.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
// propertyDoor
|
||||
//
|
||||
this.propertyDoor.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.propertyDoor.HelpVisible = false;
|
||||
this.propertyDoor.Location = new System.Drawing.Point(3, 29);
|
||||
this.propertyDoor.Name = "propertyDoor";
|
||||
this.propertyDoor.Size = new System.Drawing.Size(315, 139);
|
||||
this.propertyDoor.TabIndex = 1;
|
||||
this.propertyDoor.ToolbarVisible = false;
|
||||
//
|
||||
// UIDoorwayControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.ClientSize = new System.Drawing.Size(596, 418);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "UIDoorwayControl";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Doorway Manager";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Button btnSouth;
|
||||
private System.Windows.Forms.Button btnEast;
|
||||
private System.Windows.Forms.Button btnUp;
|
||||
private System.Windows.Forms.Button btnDown;
|
||||
private System.Windows.Forms.Button btnWest;
|
||||
private System.Windows.Forms.Button btnNorth;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.ListBox lstRooms;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Label lblDoorway;
|
||||
private System.Windows.Forms.PropertyGrid propertyDoor;
|
||||
|
||||
}
|
||||
}
|
32
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs
Normal file
32
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using MudDesigner.MudEngine.GameObjects;
|
||||
using MudDesigner.MudEngine.GameObjects.Environment;
|
||||
|
||||
namespace MudDesigner.MudEngine.UITypeEditors
|
||||
{
|
||||
public partial class UIDoorwayControl : Form
|
||||
{
|
||||
Room _Room;
|
||||
Zone _Zone;
|
||||
public Door Door { get; set; }
|
||||
|
||||
public UIDoorwayControl(Door door, Zone zone)
|
||||
{
|
||||
InitializeComponent();
|
||||
_Room = new Room();
|
||||
_Zone = new Zone();
|
||||
Door = new Door();
|
||||
|
||||
_Zone = zone;
|
||||
}
|
||||
}
|
||||
}
|
120
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.resx
Normal file
120
Mud Designer/MudEngine/UITypeEditors/UIDoorwayControl.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>
|
33
Mud Designer/MudEngine/UITypeEditors/UIDoorwayEditor.cs
Normal file
33
Mud Designer/MudEngine/UITypeEditors/UIDoorwayEditor.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing.Design;
|
||||
using System.IO;
|
||||
|
||||
using MudDesigner.MudEngine.GameObjects.Environment;
|
||||
using MudDesigner.MudEngine.GameObjects;
|
||||
using MudDesigner.MudEngine.FileSystem;
|
||||
|
||||
namespace MudDesigner.MudEngine.UITypeEditors
|
||||
{
|
||||
public class UIDoorwayEditor : UITypeEditor
|
||||
{
|
||||
public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
Door d = (Door)context.Instance;
|
||||
Zone z = new Zone();
|
||||
|
||||
UIDoorwayControl ctl = new UIDoorwayControl(d, z);
|
||||
ctl.ShowDialog();
|
||||
|
||||
return d.DoorwayLink;
|
||||
}
|
||||
|
||||
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
|
||||
{
|
||||
return System.Drawing.Design.UITypeEditorEditStyle.Modal;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -108,7 +108,7 @@
|
|||
this.groupBox2.ForeColor = System.Drawing.Color.Silver;
|
||||
this.groupBox2.Location = new System.Drawing.Point(258, 12);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(239, 336);
|
||||
this.groupBox2.Size = new System.Drawing.Size(339, 336);
|
||||
this.groupBox2.TabIndex = 1;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Members in Zone";
|
||||
|
@ -119,7 +119,7 @@
|
|||
this.propertyRoom.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.propertyRoom.Location = new System.Drawing.Point(3, 16);
|
||||
this.propertyRoom.Name = "propertyRoom";
|
||||
this.propertyRoom.Size = new System.Drawing.Size(233, 317);
|
||||
this.propertyRoom.Size = new System.Drawing.Size(333, 317);
|
||||
this.propertyRoom.TabIndex = 1;
|
||||
this.propertyRoom.ToolbarVisible = false;
|
||||
this.propertyRoom.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyRoom_PropertyValueChanged);
|
||||
|
@ -129,7 +129,7 @@
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
||||
this.ClientSize = new System.Drawing.Size(512, 356);
|
||||
this.ClientSize = new System.Drawing.Size(603, 356);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
|
|
|
@ -132,7 +132,11 @@ namespace MudDesigner.MudEngine.UITypeEditors
|
|||
{
|
||||
if (CheckSavedState())
|
||||
{
|
||||
propertyRoom.SelectedObject = new Room();
|
||||
_Room = new Room();
|
||||
_Room.Zone = _Zone.Name;
|
||||
_Room.Realm = _Zone.Realm;
|
||||
propertyRoom.SelectedObject = _Room;
|
||||
|
||||
IsSaved = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue