Standardise Theater -> Tileset.
This commit is contained in:
@@ -276,7 +276,6 @@
|
||||
<Compile Include="ReplaceWithActor.cs" />
|
||||
<Compile Include="OreRefineryDockAction.cs" />
|
||||
<Compile Include="StoresOre.cs" />
|
||||
<Compile Include="PaletteFromCurrentTheatre.cs" />
|
||||
<Compile Include="Widgets\Delegates\OrderButtonsChromeDelegate.cs" />
|
||||
<Compile Include="RadarColorFromTerrain.cs" />
|
||||
<Compile Include="EngineerRepair.cs" />
|
||||
@@ -312,6 +311,7 @@
|
||||
<Compile Include="ServerTraits\PlayerCommands.cs" />
|
||||
<Compile Include="ServerTraits\LobbyCommands.cs" />
|
||||
<Compile Include="Scripting\RASpecialPowers.cs" />
|
||||
<Compile Include="PaletteFromCurrentTileset.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||
|
||||
@@ -13,20 +13,20 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
class PaletteFromCurrentTheatreInfo : ITraitInfo
|
||||
class PaletteFromCurrentTilesetInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Name = null;
|
||||
public readonly bool Transparent = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PaletteFromCurrentTheatre(init.world, this); }
|
||||
public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.world, this); }
|
||||
}
|
||||
|
||||
class PaletteFromCurrentTheatre : IPalette
|
||||
class PaletteFromCurrentTileset : IPalette
|
||||
{
|
||||
readonly World world;
|
||||
readonly PaletteFromCurrentTheatreInfo info;
|
||||
readonly PaletteFromCurrentTilesetInfo info;
|
||||
|
||||
public PaletteFromCurrentTheatre(World world, PaletteFromCurrentTheatreInfo info)
|
||||
public PaletteFromCurrentTileset(World world, PaletteFromCurrentTilesetInfo info)
|
||||
{
|
||||
this.world = world;
|
||||
this.info = info;
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA
|
||||
class PaletteFromFileInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Name = null;
|
||||
public readonly string Theater = null;
|
||||
public readonly string Tileset = null;
|
||||
public readonly string Filename = null;
|
||||
public readonly bool Transparent = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void InitPalette( WorldRenderer wr )
|
||||
{
|
||||
if( info.Theater == null || info.Theater.ToLowerInvariant() == world.Map.Theater.ToLowerInvariant() )
|
||||
if( info.Tileset == null || info.Tileset.ToLowerInvariant() == world.Map.Tileset.ToLowerInvariant() )
|
||||
wr.AddPalette( info.Name, new Palette( FileSystem.Open( info.Filename ), info.Transparent ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA
|
||||
class PaletteFromRGBAInfo : ITraitInfo
|
||||
{
|
||||
public readonly string Name = null;
|
||||
public readonly string Theatre = null;
|
||||
public readonly string Tileset = null;
|
||||
public readonly int R = 0;
|
||||
public readonly int G = 0;
|
||||
public readonly int B = 0;
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void InitPalette( WorldRenderer wr )
|
||||
{
|
||||
if (info.Theatre == null || info.Theatre.ToLowerInvariant() == world.Map.Theater.ToLowerInvariant())
|
||||
if (info.Tileset == null || info.Tileset.ToLowerInvariant() == world.Map.Tileset.ToLowerInvariant())
|
||||
{
|
||||
// TODO: This shouldn't rely on a base palette
|
||||
var pal = wr.GetPalette("terrain");
|
||||
|
||||
Reference in New Issue
Block a user