allow custom icons on units

This commit is contained in:
Chris Forbes
2009-12-27 21:03:01 +13:00
parent 228c622145
commit 86f7f2d9c6
2 changed files with 2 additions and 1 deletions

View File

@@ -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,

View File

@@ -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; }
}