refactored a bit - something is still failing

This commit is contained in:
alzeih
2010-04-24 17:33:43 +12:00
parent 3d1d6f5e00
commit 471a5c29c8
12 changed files with 32 additions and 18 deletions

View File

@@ -36,6 +36,7 @@ namespace OpenRA.Widgets.Delegates
Players.Children.Clear();
int i = 0;
foreach(var client in Game.LobbyInfo.Clients)
{
//HACK : "the c# spec is, IMHO, broken here"
@@ -43,9 +44,12 @@ namespace OpenRA.Widgets.Delegates
Log.Write("Client {0}",c.Name);
var template = PlayerTemplate.Clone();
var pos = template.DrawPosition();
template.Id = "PLAYER_{0}".F(c.Index);
template.Parent = Players;
template.GetWidget<ButtonWidget>("NAME").GetText = () => {return c.Name; };
template.Bounds = new Rectangle(template.Bounds.X, template.Bounds.Y + i, template.Bounds.Width, template.Bounds.Height);
template.Bounds = new Rectangle(pos.X, pos.Y + i, template.Bounds.Width, template.Bounds.Height);
template.IsVisible = () => {return true;};
Players.AddChild(template);
i += 30;