Add TransparentIndex to PaletteFromFile.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
shadowIndex[shadowIndex.Length - 3] = 4;
|
||||
}
|
||||
|
||||
var palette = new ImmutablePalette(args[2], shadowIndex);
|
||||
var palette = new ImmutablePalette(args[2], new[] { 0 }, shadowIndex);
|
||||
var palColors = new Color[Palette.Size];
|
||||
for (var i = 0; i < Palette.Size; i++)
|
||||
palColors[i] = palette.GetColor(i);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
// HACK: The engine code assumes that Game.modData is set.
|
||||
var modData = Game.ModData = utility.ModData;
|
||||
|
||||
var palette = new ImmutablePalette(args[1], new int[0]);
|
||||
var palette = new ImmutablePalette(args[1], new[] { 0 }, new int[0]);
|
||||
|
||||
SequenceProvider sequences = null;
|
||||
var mapPackage = new Folder(Platform.EngineDir).OpenPackage(args[2], modData.ModFiles);
|
||||
|
||||
Reference in New Issue
Block a user