Merge branch 'master' of manuel-voegele.de:inf3

This commit is contained in:
Wafa Sadri
2014-05-09 17:42:00 +02:00
2 changed files with 5 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ namespace WorldOfPeacecraft
class Gui : Form, IGui
{
private const int ChatWidth = 300;
private const int OnlinePlayerWidth = 100;
private const int OnlinePlayerWidth = 150;
private IBackend Backend;
private MapPanel MapPanel;

View File

@@ -7,12 +7,14 @@ namespace WorldOfPeacecraft
public class OnlinePlayerList : Panel
{
private IBackend Backend;
private Image PlayerOnlineImage;
public OnlinePlayerList(IBackend backend)
{
this.Backend = backend;
SetStyle (ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
Font = new Font(Font, FontStyle.Bold);
PlayerOnlineImage = Image.FromFile("textures/playerOnline.png");
}
protected override void OnPaint (PaintEventArgs e)
@@ -25,7 +27,8 @@ namespace WorldOfPeacecraft
int count = 0;
Brush brush = new SolidBrush(Color.Black);
foreach (IPlayer player in players) {
g.DrawString(player.GetName(), Font, brush, 20, 10 + 20 * count);
g.DrawImage(PlayerOnlineImage, 10, 12 + 40 * count, 25, 32);
g.DrawString(player.GetName(), Font, brush, 40, 20 + 40 * count);
count++;
}
}