From 5516e16fb8abb9d510549c426ad19232a276a2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Tue, 7 Apr 2020 14:39:05 +0200 Subject: [PATCH] Make the default player color configurable in mod.yaml --- OpenRA.Game/DefaultPlayer.cs | 20 ++++++++++++++++++++ OpenRA.Game/Map/PlayerReference.cs | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 OpenRA.Game/DefaultPlayer.cs diff --git a/OpenRA.Game/DefaultPlayer.cs b/OpenRA.Game/DefaultPlayer.cs new file mode 100644 index 0000000000..d72e9a1cef --- /dev/null +++ b/OpenRA.Game/DefaultPlayer.cs @@ -0,0 +1,20 @@ +#region Copyright & License Information +/* + * Copyright 2007-2020 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. For more + * information, see COPYING. + */ +#endregion + +using OpenRA.Primitives; + +namespace OpenRA +{ + public class DefaultPlayer : IGlobalModData + { + public readonly Color Color = Color.FromAhsl(0, 0, 238); + } +} diff --git a/OpenRA.Game/Map/PlayerReference.cs b/OpenRA.Game/Map/PlayerReference.cs index a333bac2f9..16a4aaa693 100644 --- a/OpenRA.Game/Map/PlayerReference.cs +++ b/OpenRA.Game/Map/PlayerReference.cs @@ -30,7 +30,7 @@ namespace OpenRA public string Faction; public bool LockColor = false; - public Color Color = Color.FromAhsl(0, 0, 238); + public Color Color = Game.ModData.Manifest.Get().Color; public bool LockSpawn = false; public int Spawn = 0;