Player online list

This commit is contained in:
2014-05-09 10:38:08 +02:00
parent d0c9ec348b
commit b74a7aa301
7 changed files with 68 additions and 14 deletions

View File

@@ -9,10 +9,12 @@ namespace WorldOfPeacecraft
class Gui : Form, IGui
{
private const int ChatWidth = 300;
private const int OnlinePlayerWidth = 100;
private IBackend Backend;
private MapPanel MapPanel;
private ChatPanel ChatPanel;
private OnlinePlayerList OnlinePlayerList;
public Gui ()
{
@@ -40,11 +42,14 @@ namespace WorldOfPeacecraft
{
ChatPanel = new ChatPanel (Backend);
MapPanel = new MapPanel (Backend);
OnlinePlayerList = new OnlinePlayerList (Backend);
this.SuspendLayout();
this.Size = new Size(400 + ChatWidth, 400);
MapPanel.Location = new Point(0,0);
this.Size = new Size(OnlinePlayerWidth + 400 + ChatWidth, 400);
OnlinePlayerList.Location = new Point(0,0);
OnlinePlayerList.Size = new Size(OnlinePlayerWidth, 400);
MapPanel.Location = new Point(OnlinePlayerWidth,0);
MapPanel.Size = new Size(400, 400);
ChatPanel.Location = new Point (400, 0);
ChatPanel.Location = new Point (OnlinePlayerWidth + 400, 0);
ChatPanel.Size = new Size (300, 400);
this.DoubleBuffered = true;
this.MaximizeBox = false;
@@ -52,6 +57,7 @@ namespace WorldOfPeacecraft
this.Text = "World of Peacecraft";
this.ShowIcon = false;
this.Controls.Add (OnlinePlayerList);
this.Controls.Add (MapPanel);
this.Controls.Add (ChatPanel);
@@ -70,8 +76,10 @@ namespace WorldOfPeacecraft
{
MapPanel.PerformLayout ();
this.SuspendLayout();
this.SetClientSizeCore(MapPanel.Width + ChatWidth, MapPanel.Height);
ChatPanel.Location = new Point (MapPanel.Width, 0);
this.SetClientSizeCore(OnlinePlayerWidth + MapPanel.Width + ChatWidth, MapPanel.Height);
OnlinePlayerList.Size = new Size(OnlinePlayerWidth, MapPanel.Height);
MapPanel.Location = new Point(OnlinePlayerWidth, 0);
ChatPanel.Location = new Point (OnlinePlayerWidth + MapPanel.Width, 0);
ChatPanel.Size = new Size (ChatWidth, MapPanel.Height);
this.ResumeLayout();
ChatPanel.UpdateData ();