Use custom colors ingame; requires a map format change to kill the obsoleted "palette" field
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<PlayerColorPaletteInfo>();
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user