Abstract ColorBlockWidget away from Player

This commit is contained in:
alzeih
2010-04-25 14:03:31 +12:00
parent 99b2c03534
commit e11b2a1801
2 changed files with 6 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ namespace OpenRA.Widgets.Delegates
color.OnMouseUp = CyclePalette;
var colorBlock = color.GetWidget<ColorBlockWidget>("COLORBLOCK");
colorBlock.GetPaletteIndex = () => c.PaletteIndex;
colorBlock.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].c;
var faction = template.GetWidget<ButtonWidget>("FACTION");
faction.OnMouseUp = CycleRace;
@@ -91,7 +91,7 @@ namespace OpenRA.Widgets.Delegates
else
{
var color = template.GetWidget<ColorBlockWidget>("COLOR");
color.GetPaletteIndex = () => c.PaletteIndex;
color.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].c;
var faction = template.GetWidget<LabelWidget>("FACTION");
faction.GetText = () => c.Country;