Add TransparentIndex to PaletteFromFile.

This commit is contained in:
Paul Chote
2021-02-02 19:37:16 +00:00
committed by reaperrr
parent e63b9b4986
commit 0c52d275fa
5 changed files with 16 additions and 11 deletions

View File

@@ -31,6 +31,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("filename to load")]
public readonly string Filename = null;
[Desc("Map listed indices to transparent. Ignores previous color.")]
public readonly int[] TransparentIndex = { 0 };
[Desc("Map listed indices to shadow. Ignores previous color.")]
public readonly int[] ShadowIndex = { };
@@ -45,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
ImmutablePalette IProvidesCursorPaletteInfo.ReadPalette(IReadOnlyFileSystem fileSystem)
{
return new ImmutablePalette(fileSystem.Open(Filename), ShadowIndex);
return new ImmutablePalette(fileSystem.Open(Filename), TransparentIndex, ShadowIndex);
}
}