Add ClickThrough property to ContainerWidget.

This commit is contained in:
Paul Chote
2015-05-10 12:33:17 +01:00
parent b1dc5012c3
commit 444c02a498

View File

@@ -493,6 +493,8 @@ namespace OpenRA.Widgets
public class ContainerWidget : Widget
{
public readonly bool ClickThrough = true;
public ContainerWidget() { IgnoreMouseOver = true; }
public ContainerWidget(ContainerWidget other)
: base(other) { IgnoreMouseOver = true; }
@@ -501,6 +503,11 @@ namespace OpenRA.Widgets
public override Widget Clone() { return new ContainerWidget(this); }
public Func<KeyInput, bool> OnKeyPress = _ => false;
public override bool HandleKeyPress(KeyInput e) { return OnKeyPress(e); }
public override bool HandleMouseInput(MouseInput mi)
{
return !ClickThrough && EventBounds.Contains(mi.Location);
}
}
public class WidgetArgs : Dictionary<string, object>