fix dumb crash with dynamically initialized widgets
This commit is contained in:
@@ -26,6 +26,8 @@ namespace OpenRA.Widgets
|
|||||||
public Rectangle EventBounds;
|
public Rectangle EventBounds;
|
||||||
public Widget Parent = null;
|
public Widget Parent = null;
|
||||||
|
|
||||||
|
public Widget() { InputHandler = Lazy.New(() => BindHandler(Delegate)); }
|
||||||
|
|
||||||
public virtual void Initialize()
|
public virtual void Initialize()
|
||||||
{
|
{
|
||||||
// Parse the YAML equations to find the widget bounds
|
// Parse the YAML equations to find the widget bounds
|
||||||
@@ -54,8 +56,6 @@ namespace OpenRA.Widgets
|
|||||||
child.Initialize();
|
child.Initialize();
|
||||||
EventBounds = Rectangle.Union(EventBounds, child.EventBounds);
|
EventBounds = Rectangle.Union(EventBounds, child.EventBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputHandler = Lazy.New(() => BindHandler(Delegate));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static IWidgetDelegate BindHandler(string name)
|
static IWidgetDelegate BindHandler(string name)
|
||||||
|
|||||||
Reference in New Issue
Block a user