Merge pull request #7968 from pchote/ts-tileset-depth
Load depth data from tmp(ts) sprites.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
@@ -26,7 +27,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.World, this); }
|
||||
}
|
||||
|
||||
class PaletteFromCurrentTileset : ILoadsPalettes
|
||||
class PaletteFromCurrentTileset : ILoadsPalettes, IProvidesAssetBrowserPalettes
|
||||
{
|
||||
readonly World world;
|
||||
readonly PaletteFromCurrentTilesetInfo info;
|
||||
@@ -41,5 +42,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(GlobalFileSystem.Open(world.TileSet.Palette), info.ShadowIndex), info.AllowModifiers);
|
||||
}
|
||||
|
||||
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
@@ -29,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public object Create(ActorInitializer init) { return new PaletteFromFile(init.World, this); }
|
||||
}
|
||||
|
||||
class PaletteFromFile : ILoadsPalettes
|
||||
class PaletteFromFile : ILoadsPalettes, IProvidesAssetBrowserPalettes
|
||||
{
|
||||
readonly World world;
|
||||
readonly PaletteFromFileInfo info;
|
||||
@@ -45,14 +46,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
wr.AddPalette(info.Name, new ImmutablePalette(GlobalFileSystem.Open(info.Filename), info.ShadowIndex), info.AllowModifiers);
|
||||
}
|
||||
|
||||
public string Filename
|
||||
public IEnumerable<string> PaletteNames
|
||||
{
|
||||
get { return info.Filename; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return info.Name; }
|
||||
get
|
||||
{
|
||||
// Only expose the palette if it is available for the shellmap's tileset (which is a requirement for its use).
|
||||
if (info.Tileset == null || info.Tileset == world.TileSet.Id)
|
||||
yield return info.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -27,7 +28,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public object Create(ActorInitializer init) { return new ShroudPalette(this); }
|
||||
}
|
||||
|
||||
class ShroudPalette : ILoadsPalettes
|
||||
class ShroudPalette : ILoadsPalettes, IProvidesAssetBrowserPalettes
|
||||
{
|
||||
readonly ShroudPaletteInfo info;
|
||||
|
||||
@@ -58,5 +59,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Color.FromArgb(128, 0, 0, 0),
|
||||
Color.FromArgb(64, 0, 0, 0)
|
||||
};
|
||||
|
||||
public IEnumerable<string> PaletteNames { get { yield return info.Name; } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user