Spieler Onlineliste zeigt jetzt ein Bild neben dem Namen an
This commit is contained in:
@@ -9,7 +9,7 @@ namespace WorldOfPeacecraft
|
|||||||
class Gui : Form, IGui
|
class Gui : Form, IGui
|
||||||
{
|
{
|
||||||
private const int ChatWidth = 300;
|
private const int ChatWidth = 300;
|
||||||
private const int OnlinePlayerWidth = 100;
|
private const int OnlinePlayerWidth = 150;
|
||||||
private IBackend Backend;
|
private IBackend Backend;
|
||||||
|
|
||||||
private MapPanel MapPanel;
|
private MapPanel MapPanel;
|
||||||
|
|||||||
@@ -7,12 +7,14 @@ namespace WorldOfPeacecraft
|
|||||||
public class OnlinePlayerList : Panel
|
public class OnlinePlayerList : Panel
|
||||||
{
|
{
|
||||||
private IBackend Backend;
|
private IBackend Backend;
|
||||||
|
private Image PlayerOnlineImage;
|
||||||
|
|
||||||
public OnlinePlayerList(IBackend backend)
|
public OnlinePlayerList(IBackend backend)
|
||||||
{
|
{
|
||||||
this.Backend = backend;
|
this.Backend = backend;
|
||||||
SetStyle (ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
SetStyle (ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
||||||
Font = new Font(Font, FontStyle.Bold);
|
Font = new Font(Font, FontStyle.Bold);
|
||||||
|
PlayerOnlineImage = Image.FromFile("textures/playerOnline.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPaint (PaintEventArgs e)
|
protected override void OnPaint (PaintEventArgs e)
|
||||||
@@ -25,7 +27,8 @@ namespace WorldOfPeacecraft
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
Brush brush = new SolidBrush(Color.Black);
|
Brush brush = new SolidBrush(Color.Black);
|
||||||
foreach (IPlayer player in players) {
|
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++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user