From 6f4c674ce41773e2e335ace1d5b09a85291362e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Fri, 9 May 2014 11:00:11 +0200 Subject: [PATCH] Spieler Onlineliste zeigt jetzt ein Bild neben dem Namen an --- src/Gui/Gui.cs | 2 +- src/Gui/OnlinePlayerList.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Gui/Gui.cs b/src/Gui/Gui.cs index a82d00e..cb2140a 100644 --- a/src/Gui/Gui.cs +++ b/src/Gui/Gui.cs @@ -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; diff --git a/src/Gui/OnlinePlayerList.cs b/src/Gui/OnlinePlayerList.cs index a9bf661..dcc2bc6 100644 --- a/src/Gui/OnlinePlayerList.cs +++ b/src/Gui/OnlinePlayerList.cs @@ -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++; } }