fix most of the palette issues with RA desert in OpenRA.Editor

TODO: use the palette as defined in YAML;
defaults are wrong for DESERT rocks, trees, walls and ore mine
This commit is contained in:
Matthias Mailänder
2012-11-19 14:53:25 +01:00
parent 842fd8b4e5
commit 0690041347
2 changed files with 15 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ namespace OpenRA.Editor
public Map Map { get; private set; }
public TileSet TileSet { get; private set; }
public Palette Palette { get; private set; }
public Palette PlayerPalette { get; private set; }
public int2 Offset;
public int2 GetOffset() { return Offset; }
@@ -55,11 +56,12 @@ namespace OpenRA.Editor
public Keys GetModifiers() { return ModifierKeys; }
public void Bind(Map m, TileSet ts, Palette p)
public void Bind(Map m, TileSet ts, Palette p, Palette pp)
{
Map = m;
TileSet = ts;
Palette = p;
PlayerPalette = pp;
PlayerPalettes = null;
Chunks.Clear();
Tool = null;
@@ -348,7 +350,7 @@ namespace OpenRA.Editor
var pr = Map.Players[name];
var pcpi = Rules.Info["player"].Traits.Get<PlayerColorPaletteInfo>();
var remap = new PlayerColorRemap(pcpi.RemapIndex, pr.ColorRamp);
return new Palette(Palette, remap).AsSystemPalette();
return new Palette(PlayerPalette, remap).AsSystemPalette();
}
Cache<string, ColorPalette> PlayerPalettes;