Decouple color picker palette definitions to their own trait.

This commit is contained in:
Paul Chote
2021-05-09 15:23:33 +01:00
committed by teinarss
parent 57d955ec72
commit 3bc42543fa
17 changed files with 116 additions and 50 deletions

View File

@@ -235,11 +235,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
orderManager.IssueOrder(Order.Command($"color {client.Index} {colorManager.Color}"));
};
Action<Color> onChange = c => colorManager.Update(worldRenderer, c);
var colorChooser = Game.LoadWidget(worldRenderer.World, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onChange", onChange },
{ "onChange", (Action<Color>)(c => colorManager.Color = c) },
{ "initialColor", client.Color },
{ "initialFaction", client.Faction }
});