Make sure palettes are updated if colors are toggled in game runtime
And fix MutablePalette's not getting updated
This commit is contained in:
committed by
Matthias Mailänder
parent
5fc36bd45f
commit
239891070d
@@ -85,7 +85,10 @@ namespace OpenRA.Graphics
|
||||
public void ReplacePalette(string name, IPalette p)
|
||||
{
|
||||
if (mutablePalettes.ContainsKey(name))
|
||||
{
|
||||
palettes[name] = new ImmutablePalette(p);
|
||||
CopyPaletteToBuffer(indices[name], mutablePalettes[name] = new MutablePalette(p));
|
||||
}
|
||||
else if (palettes.ContainsKey(name))
|
||||
CopyPaletteToBuffer(indices[name], palettes[name] = new ImmutablePalette(p));
|
||||
else
|
||||
|
||||
@@ -62,10 +62,7 @@ namespace OpenRA.Graphics
|
||||
foreach (var pal in world.TraitDict.ActorsWithTrait<ILoadsPalettes>())
|
||||
pal.Trait.LoadPalettes(this);
|
||||
|
||||
foreach (var p in world.Players)
|
||||
UpdatePalettesForPlayer(p.InternalName, p.Color, false);
|
||||
|
||||
Player.SetupRelationshipColors(world.Players, world.LocalPlayer);
|
||||
Player.SetupRelationshipColors(world.Players, world.LocalPlayer, this, true);
|
||||
|
||||
palette.Initialize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user