Mud Designer UI:
- Began support work on the networking side of the designer UI. Attempts to connect to the server or run stand-alone. - Began implementing object creation. Mud Engine: - Added the [Browsable(false)] attribute to several Game properties so they are not visible within the new Designer.
This commit is contained in:
parent
a347607337
commit
f446c754fb
9 changed files with 556 additions and 56 deletions
|
@ -7,6 +7,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
using MudEngine.GameManagement;
|
||||
using MudEngine.FileSystem;
|
||||
|
@ -16,18 +17,27 @@ namespace MudDesigner
|
|||
public partial class frmDesigner : Form
|
||||
{
|
||||
private Game _Game;
|
||||
private Client _Client;
|
||||
private Thread _ClientThread;
|
||||
|
||||
private Boolean _IsRenaming;
|
||||
private String _OldName;
|
||||
|
||||
public frmDesigner(Game game)
|
||||
private Boolean _TimeOut;
|
||||
private Object _SelectedObject;
|
||||
|
||||
public frmDesigner(Game game, Client client)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_Game = game;
|
||||
_Client = client;
|
||||
|
||||
MudEngine.GameObjects.Environment.Room r = new MudEngine.GameObjects.Environment.Room(_Game);
|
||||
this.propertyGrid1.SelectedObject = _Game;
|
||||
|
||||
_TimeOut = false;
|
||||
_Client.Send("Hello world", false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -73,5 +83,58 @@ namespace MudDesigner
|
|||
_OldName = e.OldValue.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeObject(Object obj)
|
||||
{
|
||||
_SelectedObject = obj;
|
||||
propertyGrid1.SelectedObject = obj;
|
||||
}
|
||||
|
||||
private void btnNewRealm_Click(object sender, EventArgs e)
|
||||
{
|
||||
ChangeObject(new MudEngine.GameObjects.Environment.Realm(_Game));
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ChangeObject(new MudEngine.GameObjects.Environment.Zone(_Game));
|
||||
}
|
||||
|
||||
private void txtCommand_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
_Client.Send(txtCommand.Text, true);
|
||||
|
||||
System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
|
||||
t.Interval = 10000;
|
||||
t.Tick += new EventHandler(timerTick);
|
||||
|
||||
_TimeOut = false;
|
||||
String result;
|
||||
|
||||
while (!_TimeOut)
|
||||
{
|
||||
if (_Client.Receive(out result, 1))
|
||||
{
|
||||
txtConsole.Text += result;
|
||||
}
|
||||
else
|
||||
_TimeOut = true;
|
||||
}
|
||||
|
||||
txtConsole.Text += "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void timerTick(object sender, EventArgs e)
|
||||
{
|
||||
_TimeOut = true;
|
||||
}
|
||||
|
||||
void UpdateConsole(String message)
|
||||
{
|
||||
txtConsole.Text += message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue