unify C&C and RA colorpicker palette manipulation code
This commit is contained in:
@@ -16,6 +16,7 @@ using OpenRA.FileFormats;
|
||||
using OpenRA.Network;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Widgets.Logic;
|
||||
|
||||
namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
@@ -32,7 +33,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
string MapUid;
|
||||
Map Map;
|
||||
|
||||
CncColorPickerPaletteModifier PlayerPalettePreview;
|
||||
ColorPickerPaletteModifier PlayerPalettePreview;
|
||||
|
||||
readonly Action OnGameStart;
|
||||
readonly Action onExit;
|
||||
@@ -102,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
|
||||
Game.ConnectionStateChanged += ConnectionStateChanged;
|
||||
|
||||
UpdateCurrentMap();
|
||||
PlayerPalettePreview = world.WorldActor.Trait<CncColorPickerPaletteModifier>();
|
||||
PlayerPalettePreview = world.WorldActor.Trait<ColorPickerPaletteModifier>();
|
||||
PlayerPalettePreview.Ramp = Game.Settings.Player.ColorRamp;
|
||||
Players = lobby.GetWidget<ScrollPanelWidget>("PLAYERS");
|
||||
EditablePlayerTemplate = Players.GetWidget("TEMPLATE_EDITABLE_PLAYER");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user