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