Use DisplayColor in lobby

This commit is contained in:
Paul Chote
2010-02-06 14:07:48 +13:00
parent c78ce442c6
commit b3a0ff0e81
2 changed files with 14 additions and 9 deletions

View File

@@ -411,10 +411,6 @@ namespace OpenRa
DrawDialogBackground(paletteRect, "panel"); DrawDialogBackground(paletteRect, "panel");
AddButton(paletteRect, CyclePalette); AddButton(paletteRect, CyclePalette);
// TODO: Render using the System.Drawing.Color (Player.PlayerColors[client.PaletteIndex].c)
shpRenderer.DrawSprite(colorBlock, new float2(paletteRect.Left + 4, paletteRect.Top + 4),
Player.PlayerColors[client.PaletteIndex].a);
var raceRect = new Rectangle(r.Left + 290, y - 2, 65, 22); var raceRect = new Rectangle(r.Left + 290, y - 2, 65, 22);
DrawDialogBackground(raceRect, "panel"); DrawDialogBackground(raceRect, "panel");
AddButton(raceRect, CycleRace); AddButton(raceRect, CycleRace);
@@ -427,11 +423,12 @@ namespace OpenRa
shpRenderer.Flush(); shpRenderer.Flush();
renderer.DrawText(client.Name, new int2(r.Left + 40, y), Color.White); renderer.DrawText(client.Name, new int2(r.Left + 40, y), Color.White);
lineRenderer.FillRect(RectangleF.FromLTRB(paletteRect.Left + Game.viewport.Location.X + 5,
// TODO: Render using Player.PlayerColors[client.PaletteIndex].c paletteRect.Top + Game.viewport.Location.Y + 5,
shpRenderer.DrawSprite(colorBlock, new float2(paletteRect.Left + 4, paletteRect.Top + 4), paletteRect.Right + Game.viewport.Location.X - 5,
Player.PlayerColors[client.PaletteIndex].a); paletteRect.Bottom+Game.viewport.Location.Y - 5),
Player.PlayerColors[client.PaletteIndex].c);
lineRenderer.Flush();
renderer.DrawText(((Race)client.Race).ToString(), new int2(r.Left + 300, y), Color.White); renderer.DrawText(((Race)client.Race).ToString(), new int2(r.Left + 300, y), Color.White);
renderer.DrawText(client.State.ToString(), new int2(r.Left + 370, y), Color.White); renderer.DrawText(client.State.ToString(), new int2(r.Left + 370, y), Color.White);
y += 30; y += 30;

View File

@@ -57,5 +57,13 @@ namespace OpenRa.Graphics
if( ++lines >= linesPerBatch ) if( ++lines >= linesPerBatch )
Flush(); Flush();
} }
public void FillRect( RectangleF r, Color color )
{
for (float y = r.Top; y < r.Bottom; y++)
{
DrawLine(new float2(r.Left, y), new float2(r.Right, y), color, color);
}
}
} }
} }