From 86f7f2d9c65cbf9153f4c54401d13ecd6cd27622 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 27 Dec 2009 21:03:01 +1300 Subject: [PATCH] allow custom icons on units --- OpenRa.Game/Chrome.cs | 2 +- OpenRa.Game/GameRules/UnitInfo.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRa.Game/Chrome.cs b/OpenRa.Game/Chrome.cs index 62864f28f9..e17d5b9fbb 100644 --- a/OpenRa.Game/Chrome.cs +++ b/OpenRa.Game/Chrome.cs @@ -57,7 +57,7 @@ namespace OpenRa.Game .Where(u => Rules.UnitInfo[u].TechLevel != -1) .ToDictionary( u => u, - u => SpriteSheetBuilder.LoadAllSprites(u + "icon")[0]); + u => SpriteSheetBuilder.LoadAllSprites(Rules.UnitInfo[u].Icon ?? (u + "icon"))[0]); tabSprites = groups.Select( (g, i) => Pair.New(g, diff --git a/OpenRa.Game/GameRules/UnitInfo.cs b/OpenRa.Game/GameRules/UnitInfo.cs index ca761b22cf..03aa28886a 100755 --- a/OpenRa.Game/GameRules/UnitInfo.cs +++ b/OpenRa.Game/GameRules/UnitInfo.cs @@ -51,6 +51,7 @@ namespace OpenRa.Game.GameRules public readonly int FireDelay = 0; public readonly string LongDesc = null; public readonly int OrePips = 0; + public readonly string Icon = null; public UnitInfo(string name) { Name = name; } }