diff --git a/OpenRA.FileFormats/Map/PlayerReference.cs b/OpenRA.FileFormats/Map/PlayerReference.cs index dde221c2df..905b6b0bf8 100644 --- a/OpenRA.FileFormats/Map/PlayerReference.cs +++ b/OpenRA.FileFormats/Map/PlayerReference.cs @@ -18,6 +18,7 @@ */ #endregion +using System.Drawing; namespace OpenRA.FileFormats { public class PlayerReference @@ -27,6 +28,8 @@ namespace OpenRA.FileFormats public readonly string Race; public readonly bool OwnsWorld = false; public readonly bool NonCombatant = false; + public readonly Color Color = Color.FromArgb(238,238,238); + public readonly Color Color2 = Color.FromArgb(44,28,24); public PlayerReference(MiniYaml my) { diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 2d087df1da..5a2e766986 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -56,8 +56,8 @@ namespace OpenRA Index = index; Palette = "player"+index; - Color = Util.ArrayToColor(new int[] {93,194,165}); - Color2 = Util.ArrayToColor(new int[] {0,32,32}); + Color = pr.Color; + Color2 = pr.Color2; PlayerName = InternalName = pr.Name; NonCombatant = pr.NonCombatant; @@ -76,8 +76,8 @@ namespace OpenRA Index = client.Index; Palette = "player"+client.Index; - Color = Util.ArrayToColor(new int[] {93,194,165}); - Color2 = Util.ArrayToColor(new int[] {0,32,32}); + Color = client.Color1; + Color2 = client.Color2; PlayerName = client.Name; InternalName = "Multi{0}".F(client.Index); Country = world.GetCountries() @@ -92,7 +92,7 @@ namespace OpenRA var info = Rules.Info["world"].Traits.Get(); var newpal = new Palette(world.WorldRenderer.GetPalette(info.BasePalette), new PlayerColorRemap(Color, Color2, info.SplitRamp)); - world.WorldRenderer.AddPalette(palette, newpal); + world.WorldRenderer.AddPalette(palette, newpal); } public void GiveAdvice(string advice) diff --git a/mods/ra/maps/shellmap/map.yaml b/mods/ra/maps/shellmap/map.yaml index 50d68c3c7f..58f7b371ff 100644 --- a/mods/ra/maps/shellmap/map.yaml +++ b/mods/ra/maps/shellmap/map.yaml @@ -19,23 +19,23 @@ BottomRight: 118,93 Players: PlayerReference@Neutral: Name: Neutral - Palette: neutral Race: allies OwnsWorld: True NonCombatant: True PlayerReference@GoodGuy: Name: GoodGuy - Palette: player1 + Color: 85,130,204 + Color2: 17,33,71 Race: allies OwnsWorld: False NonCombatant: False PlayerReference@Greece: Name: Greece - Palette: player4 + Color: 255,20,0 + Color2: 56,0,0 Race: soviet OwnsWorld: False NonCombatant: False - Actors: ActorReference@Actor0: Id: Actor0