Show FixedColorPalette options in the asset browser.

This commit is contained in:
Paul Chote
2025-03-29 21:32:24 +00:00
committed by Gustas Kažukauskas
parent d26d9e0b9c
commit 76cbd5582d

View File

@@ -9,6 +9,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Primitives;
@@ -40,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits
public override object Create(ActorInitializer init) { return new FixedColorPalette(this); }
}
public class FixedColorPalette : ILoadsPalettes
public class FixedColorPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
{
readonly FixedColorPaletteInfo info;
@@ -54,5 +55,7 @@ namespace OpenRA.Mods.Common.Traits
var remap = new PlayerColorRemap(info.RemapIndex.Length == 0 ? Enumerable.Range(0, 256).ToArray() : info.RemapIndex, info.Color);
wr.AddPalette(info.Name, new ImmutablePalette(wr.Palette(info.Base).Palette, remap), info.AllowModifiers);
}
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
}
}