unify C&C and RA colorpicker palette manipulation code

This commit is contained in:
Chris Forbes
2011-10-18 20:00:24 +13:00
parent bc6af1841b
commit 89ea4d1e0a
8 changed files with 20 additions and 64 deletions

View File

@@ -14,6 +14,7 @@ using System.Linq;
using OpenRA.FileFormats;
using OpenRA.FileFormats.Graphics;
using OpenRA.GameRules;
using OpenRA.Mods.RA;
using OpenRA.Mods.RA.Widgets.Logic;
using OpenRA.Widgets;
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
enum PanelType { General, Input }
PanelType Settings = PanelType.General;
CncColorPickerPaletteModifier playerPalettePreview;
ColorPickerPaletteModifier playerPalettePreview;
World world;
[ObjectCreator.UseCtor]
@@ -53,7 +54,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
var nameTextfield = generalPane.GetWidget<TextFieldWidget>("NAME_TEXTFIELD");
nameTextfield.Text = playerSettings.Name;
playerPalettePreview = world.WorldActor.Trait<CncColorPickerPaletteModifier>();
playerPalettePreview = world.WorldActor.Trait<ColorPickerPaletteModifier>();
playerPalettePreview.Ramp = playerSettings.ColorRamp;
var colorDropdown = generalPane.GetWidget<DropDownButtonWidget>("COLOR_DROPDOWN");