From 4325e1b400881ecda66b89c9ffa37f23a134e4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 Jul 2016 14:40:47 +0200 Subject: [PATCH] Let pipImages tick using the appropriate interface. --- OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs index a9510414aa..5a9507c21d 100644 --- a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs +++ b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.Common.Traits.Render public int[] SelectionBoxBounds { get { return VisualBounds; } } } - public class SelectionDecorations : IPostRenderSelection + public class SelectionDecorations : IPostRenderSelection, ITick { // depends on the order of pips in TraitsInterfaces.cs! static readonly string[] PipStrings = { "pip-empty", "pip-green", "pip-yellow", "pip-red", "pip-gray", "pip-blue", "pip-ammo", "pip-ammoempty" }; @@ -115,7 +115,6 @@ namespace OpenRA.Mods.Common.Traits.Render var pal = wr.Palette(Info.Palette); pipImages.PlayFetchIndex(Info.GroupSequence, () => (int)group); - pipImages.Tick(); var pos = basePosition - (0.5f * pipImages.Image.Size.XY).ToInt2() + new int2(9, 5); yield return new UISpriteRenderable(pipImages.Image, self.CenterPosition, pos, 0, pal, 1f); @@ -156,5 +155,10 @@ namespace OpenRA.Mods.Common.Traits.Render pipxyOffset = new int2(0, pipxyOffset.Y - (pipSize.Y + 1)); } } + + void ITick.Tick(Actor self) + { + pipImages.Tick(); + } } }