diff --git a/OpenRA.Game/Chat.cs b/OpenRA.Game/Chat.cs index ac68dc5dcc..0601d925a5 100644 --- a/OpenRA.Game/Chat.cs +++ b/OpenRA.Game/Chat.cs @@ -63,7 +63,7 @@ namespace OpenRA public void AddLine(Session.Client p, string text) { - AddLine(Player.PlayerColors( Game.world )[p.PaletteIndex].c, p.Name, text); + AddLine(Player.PlayerColors( Game.world )[p.PaletteIndex].Color, p.Name, text); } public void AddLine(Color c, string from, string text) diff --git a/OpenRA.Game/Graphics/Minimap.cs b/OpenRA.Game/Graphics/Minimap.cs index a4f52a2976..ea676ff4ef 100644 --- a/OpenRA.Game/Graphics/Minimap.cs +++ b/OpenRA.Game/Graphics/Minimap.cs @@ -188,7 +188,7 @@ namespace OpenRA.Graphics lineRenderer.FillRect(new RectangleF( Game.viewport.Location.X + pos.X + 2, Game.viewport.Location.Y + pos.Y + 2, - 12, 12), Player.PlayerColors(world)[ p.Second.PaletteIndex % Player.PlayerColors(world).Count() ].c); + 12, 12), Player.PlayerColors(world)[ p.Second.PaletteIndex % Player.PlayerColors(world).Count() ].Color); rgbaRenderer.DrawSprite(ownedSpawnPoint, pos, "chrome"); } diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index f5e8038a55..b3836d8444 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -53,11 +53,10 @@ namespace OpenRA public ShroudRenderer Shroud; public World World { get; private set; } - public static List> PlayerColors(World world) - { - return world.WorldActor.Info.Traits.WithInterface() - .Where(p => p.Playable) - .Select(p => OpenRA.FileFormats.Tuple.New(p.Name, p.DisplayName, p.Color)) + public static List PlayerColors(World world) + { + return world.WorldActor.Info.Traits.WithInterface() + .Where(p => p.Playable) .ToList(); } @@ -71,8 +70,8 @@ namespace OpenRA if (client != null) { Index = client.Index; - Palette = PlayerColors(world)[client.PaletteIndex % PlayerColors(world).Count()].a; - Color = PlayerColors(world)[client.PaletteIndex % PlayerColors(world).Count()].c; + Palette = PlayerColors(world)[client.PaletteIndex % PlayerColors(world).Count()].Name; + Color = PlayerColors(world)[client.PaletteIndex % PlayerColors(world).Count()].Color; PlayerName = client.Name; InternalName = "Multi{0}".F(client.Index); } diff --git a/OpenRA.Game/Traits/World/PlayerColorPalette.cs b/OpenRA.Game/Traits/World/PlayerColorPalette.cs index 98ab8968ec..0a14850066 100644 --- a/OpenRA.Game/Traits/World/PlayerColorPalette.cs +++ b/OpenRA.Game/Traits/World/PlayerColorPalette.cs @@ -23,7 +23,7 @@ using OpenRA.FileFormats; namespace OpenRA.Traits { - class PlayerColorPaletteInfo : ITraitInfo + public class PlayerColorPaletteInfo : ITraitInfo { public readonly string Name = null; public readonly string DisplayName = null; @@ -41,7 +41,7 @@ namespace OpenRA.Traits public Color Color { get { return Util.ArrayToColor(DisplayColor); } } } - class PlayerColorPalette + public class PlayerColorPalette { public PlayerColorPalette(Actor self, PlayerColorPaletteInfo info) { diff --git a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs index 2800facc3a..9fad30ce6f 100644 --- a/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/LobbyDelegate.cs @@ -70,7 +70,7 @@ namespace OpenRA.Widgets.Delegates color.OnMouseUp = CyclePalette; var colorBlock = color.GetWidget("COLORBLOCK"); - colorBlock.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].c; + colorBlock.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].Color; var faction = template.GetWidget("FACTION"); faction.OnMouseUp = CycleRace; @@ -91,7 +91,7 @@ namespace OpenRA.Widgets.Delegates else { var color = template.GetWidget("COLOR"); - color.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].c; + color.GetColor = () => Player.PlayerColors(Game.world)[c.PaletteIndex % Player.PlayerColors(Game.world).Count].Color; var faction = template.GetWidget("FACTION"); faction.GetText = () => c.Country; diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Game/Widgets/MapPreviewWidget.cs index f5e073902a..c9ae50ca94 100755 --- a/OpenRA.Game/Widgets/MapPreviewWidget.cs +++ b/OpenRA.Game/Widgets/MapPreviewWidget.cs @@ -78,7 +78,7 @@ namespace OpenRA.Widgets Game.chrome.lineRenderer.FillRect(new RectangleF( Game.viewport.Location.X + pos.X + 2, Game.viewport.Location.Y + pos.Y + 2, - 12, 12), playerColors[p.Second.PaletteIndex % playerColors.Count()].c); + 12, 12), playerColors[p.Second.PaletteIndex % playerColors.Count()].Color); Game.chrome.renderer.RgbaSpriteRenderer.DrawSprite( ChromeProvider.GetImage(Game.chrome.renderer, "spawnpoints", "owned"), pos, "chrome");