diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 8cfc2810a6..630e4cc769 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -52,6 +52,8 @@ namespace OpenRA.Widgets public Func OnMouseMove = mi => {return false;}; public Func IsVisible; + public Widget() { IsVisible = () => Visible; } + public virtual void Initialize() { // Parse the YAML equations to find the widget bounds @@ -74,7 +76,6 @@ namespace OpenRA.Widgets height); // Non-static func definitions - IsVisible = () => {return Visible;}; if (Delegate != null && !Delegates.Contains(Delegate)) Delegates.Add(Delegate);