Animate the C&C color picker preview.
This commit is contained in:
@@ -110,6 +110,7 @@ NEW:
|
||||
Fixed Obelisk of Light charge animation and sound not playing.
|
||||
Replaced or improved several mouse cursors.
|
||||
Added Minibibs for bibless buildings.
|
||||
The Construction Yard fans now turn in the color picker preview.
|
||||
Engine:
|
||||
Converted Aircraft CruiseAltitude to world coordinates.
|
||||
Converted Health Radius to world coordinates.
|
||||
|
||||
@@ -20,6 +20,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
[ObjectCreator.UseCtor]
|
||||
public ColorPickerLogic(Widget widget, HSLColor initialColor, Action<HSLColor> onChange, WorldRenderer worldRenderer)
|
||||
{
|
||||
var ticker = widget.GetOrNull<LogicTickerWidget>("ANIMATE_PREVIEW");
|
||||
if (ticker != null)
|
||||
{
|
||||
var preview = widget.Get<SpriteSequenceWidget>("PREVIEW");
|
||||
var anim = preview.GetAnimation();
|
||||
anim.PlayRepeating(anim.CurrentSequence.Name);
|
||||
ticker.OnTick = () => anim.Tick();
|
||||
}
|
||||
|
||||
var hueSlider = widget.Get<SliderWidget>("HUE");
|
||||
var mixer = widget.Get<ColorMixerWidget>("MIXER");
|
||||
var randomButton = widget.GetOrNull<ButtonWidget>("RANDOM_BUTTON");
|
||||
|
||||
@@ -4,6 +4,7 @@ Background@COLOR_CHOOSER:
|
||||
Width:234
|
||||
Height:105
|
||||
Children:
|
||||
LogicTicker@ANIMATE_PREVIEW:
|
||||
Background@HUEBG:
|
||||
Background:panel-black
|
||||
X:5
|
||||
@@ -29,7 +30,7 @@ Background@COLOR_CHOOSER:
|
||||
Y:2
|
||||
Width:144
|
||||
Height:72
|
||||
SpriteSequence@FACT:
|
||||
SpriteSequence@PREVIEW:
|
||||
X:153
|
||||
Y:1
|
||||
Width:80
|
||||
|
||||
Reference in New Issue
Block a user