diff --git a/OpenRA.Game/Map/TileSet.cs b/OpenRA.Game/Map/TileSet.cs index 2c5291c786..0a4854409a 100644 --- a/OpenRA.Game/Map/TileSet.cs +++ b/OpenRA.Game/Map/TileSet.cs @@ -185,7 +185,6 @@ namespace OpenRA public readonly string Id; public readonly int SheetSize = 512; public readonly string Palette; - public readonly string PlayerPalette; public readonly Color[] HeightDebugColors = new[] { Color.Red }; public readonly string[] EditorTemplateOrder; public readonly bool IgnoreTileSpriteOffsets; diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index cbbbecefc0..4fa91f8ca4 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -534,7 +534,6 @@ - diff --git a/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs b/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs deleted file mode 100644 index 811a8ba5a4..0000000000 --- a/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs +++ /dev/null @@ -1,47 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using OpenRA.Graphics; -using OpenRA.Traits; - -namespace OpenRA.Mods.Common.Traits -{ - class PlayerPaletteFromCurrentTilesetInfo : ITraitInfo - { - [FieldLoader.Require, PaletteDefinition(true)] - [Desc("internal palette name")] - public readonly string Name = null; - [Desc("Map listed indices to shadow.")] - public readonly int[] ShadowIndex = { }; - [Desc("Apply palette rotators or not.")] - public readonly bool AllowModifiers = true; - - public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); } - } - - class PlayerPaletteFromCurrentTileset : ILoadsPalettes - { - readonly World world; - readonly PlayerPaletteFromCurrentTilesetInfo info; - - public PlayerPaletteFromCurrentTileset(World world, PlayerPaletteFromCurrentTilesetInfo info) - { - this.world = world; - this.info = info; - } - - public void LoadPalettes(WorldRenderer wr) - { - var filename = world.Map.Rules.TileSet.PlayerPalette ?? world.Map.Rules.TileSet.Palette; - wr.AddPalette(info.Name, new ImmutablePalette(wr.World.Map.Open(filename), info.ShadowIndex), info.AllowModifiers); - } - } -} diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index a2e85c9064..834780b39e 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -977,7 +977,7 @@ namespace OpenRA.Mods.Common.UtilityCommands // nuke launch animation is now it's own trait if (engineVersion < 20170820) { - if (depth == 1 && node.Key.StartsWith("NukePower")) + if (depth == 1 && node.Key.StartsWith("NukePower", StringComparison.Ordinal)) { node.Value.Nodes.RemoveAll(n => n.Key == "ActivationSequence"); addNodes.Add(new MiniYamlNode("WithNukeLaunchAnimation", new MiniYaml(""))); @@ -992,6 +992,17 @@ namespace OpenRA.Mods.Common.UtilityCommands RenameNodeKey(node, "WithEmbeddedTurretSpriteBody"); } + if (engineVersion < 20170916) + { + if (node.Key.StartsWith("PlayerPaletteFromCurrentTileset", StringComparison.Ordinal)) + { + node.Value.Nodes.Add(new MiniYamlNode("Filename", "")); + node.Value.Nodes.Add(new MiniYamlNode("Tileset", "")); + RenameNodeKey(node, "PaletteFromFile"); + Console.WriteLine("The trait PlayerPaletteFromCurrentTileset has been removed. Use PaletteFromFile with a Tileset filter."); + } + } + UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); } diff --git a/mods/ra/tilesets/desert.yaml b/mods/ra/tilesets/desert.yaml index 9e11023295..875e8a4106 100644 --- a/mods/ra/tilesets/desert.yaml +++ b/mods/ra/tilesets/desert.yaml @@ -2,7 +2,6 @@ General: Name: Desert Id: DESERT Palette: desert.pal - PlayerPalette: temperat.pal EditorTemplateOrder: Terrain, Debris, Road, Cliffs, Water Cliffs, Beach, River, Bridge HeightDebugColors: 880000