Use custom colors ingame; requires a map format change to kill the obsoleted "palette" field

This commit is contained in:
Paul Chote
2010-07-16 23:47:33 +12:00
parent c4442f07da
commit bce5f2c681
3 changed files with 12 additions and 9 deletions

View File

@@ -18,6 +18,7 @@
*/ */
#endregion #endregion
using System.Drawing;
namespace OpenRA.FileFormats namespace OpenRA.FileFormats
{ {
public class PlayerReference public class PlayerReference
@@ -27,6 +28,8 @@ namespace OpenRA.FileFormats
public readonly string Race; public readonly string Race;
public readonly bool OwnsWorld = false; public readonly bool OwnsWorld = false;
public readonly bool NonCombatant = 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) public PlayerReference(MiniYaml my)
{ {

View File

@@ -56,8 +56,8 @@ namespace OpenRA
Index = index; Index = index;
Palette = "player"+index; Palette = "player"+index;
Color = Util.ArrayToColor(new int[] {93,194,165}); Color = pr.Color;
Color2 = Util.ArrayToColor(new int[] {0,32,32}); Color2 = pr.Color2;
PlayerName = InternalName = pr.Name; PlayerName = InternalName = pr.Name;
NonCombatant = pr.NonCombatant; NonCombatant = pr.NonCombatant;
@@ -76,8 +76,8 @@ namespace OpenRA
Index = client.Index; Index = client.Index;
Palette = "player"+client.Index; Palette = "player"+client.Index;
Color = Util.ArrayToColor(new int[] {93,194,165}); Color = client.Color1;
Color2 = Util.ArrayToColor(new int[] {0,32,32}); Color2 = client.Color2;
PlayerName = client.Name; PlayerName = client.Name;
InternalName = "Multi{0}".F(client.Index); InternalName = "Multi{0}".F(client.Index);
Country = world.GetCountries() Country = world.GetCountries()

View File

@@ -19,23 +19,23 @@ BottomRight: 118,93
Players: Players:
PlayerReference@Neutral: PlayerReference@Neutral:
Name: Neutral Name: Neutral
Palette: neutral
Race: allies Race: allies
OwnsWorld: True OwnsWorld: True
NonCombatant: True NonCombatant: True
PlayerReference@GoodGuy: PlayerReference@GoodGuy:
Name: GoodGuy Name: GoodGuy
Palette: player1 Color: 85,130,204
Color2: 17,33,71
Race: allies Race: allies
OwnsWorld: False OwnsWorld: False
NonCombatant: False NonCombatant: False
PlayerReference@Greece: PlayerReference@Greece:
Name: Greece Name: Greece
Palette: player4 Color: 255,20,0
Color2: 56,0,0
Race: soviet Race: soviet
OwnsWorld: False OwnsWorld: False
NonCombatant: False NonCombatant: False
Actors: Actors:
ActorReference@Actor0: ActorReference@Actor0:
Id: Actor0 Id: Actor0