From af3d6792b851c5f898fb8edceb6ade842d32beb5 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:04:10 +0300 Subject: [PATCH] Fix ProductionPalette ClockAnimation and NotBuildableAnimation being ignored. --- OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs index b64f2ba76d..1be204a3b3 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs @@ -111,8 +111,8 @@ namespace OpenRA.Mods.Common.Widgets public override Rectangle EventBounds => eventBounds; Dictionary icons = new Dictionary(); - readonly Animation cantBuild; - readonly Animation clock; + Animation cantBuild; + Animation clock; Rectangle eventBounds = Rectangle.Empty; readonly WorldRenderer worldRenderer; @@ -155,16 +155,15 @@ namespace OpenRA.Mods.Common.Widgets GetTooltipIcon = () => TooltipIcon; tooltipContainer = Exts.Lazy(() => Ui.Root.Get(TooltipContainer)); - - cantBuild = new Animation(world, NotBuildableAnimation); - cantBuild.PlayFetchIndex(NotBuildableSequence, () => 0); - clock = new Animation(world, ClockAnimation); } public override void Initialize(WidgetArgs args) { base.Initialize(args); + clock = new Animation(World, ClockAnimation); + cantBuild = new Animation(World, NotBuildableAnimation); + cantBuild.PlayFetchIndex(NotBuildableSequence, () => 0); hotkeys = Exts.MakeArray(HotkeyCount, i => modData.Hotkeys[HotkeyPrefix + (i + 1).ToString("D2")]);