Include all the relevant palettes in the asset browser.

This commit is contained in:
Paul Chote
2015-04-16 19:03:26 +01:00
parent c4a63eee30
commit 8b7453070a
10 changed files with 46 additions and 18 deletions

View File

@@ -65,8 +65,8 @@
<Compile Include="Traits\Render\WithVoxelWalkerBody.cs" />
<Compile Include="Traits\Render\WithVoxelUnloadBody.cs" />
<Compile Include="Traits\World\VoxelNormalsPalette.cs" />
<Compile Include="Traits\World\ShroudPalette.cs" />
<Compile Include="UtilityCommands\LegacyTilesetImporter.cs" />
<Compile Include="Traits\World\TSShroudPalette.cs" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -9,8 +9,10 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.TS.Traits
@@ -24,7 +26,7 @@ namespace OpenRA.Mods.TS.Traits
public object Create(ActorInitializer init) { return new TSShroudPalette(this); }
}
class TSShroudPalette : ILoadsPalettes
class TSShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
{
readonly TSShroudPaletteInfo info;
@@ -41,5 +43,7 @@ namespace OpenRA.Mods.TS.Traits
wr.AddPalette(info.Name, new ImmutablePalette(Enumerable.Range(0, Palette.Size).Select(i => makeColor(i))));
}
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
}
}