Add ClickThrough property to ContainerWidget.
This commit is contained in:
@@ -493,6 +493,8 @@ namespace OpenRA.Widgets
|
|||||||
|
|
||||||
public class ContainerWidget : Widget
|
public class ContainerWidget : Widget
|
||||||
{
|
{
|
||||||
|
public readonly bool ClickThrough = true;
|
||||||
|
|
||||||
public ContainerWidget() { IgnoreMouseOver = true; }
|
public ContainerWidget() { IgnoreMouseOver = true; }
|
||||||
public ContainerWidget(ContainerWidget other)
|
public ContainerWidget(ContainerWidget other)
|
||||||
: base(other) { IgnoreMouseOver = true; }
|
: base(other) { IgnoreMouseOver = true; }
|
||||||
@@ -501,6 +503,11 @@ namespace OpenRA.Widgets
|
|||||||
public override Widget Clone() { return new ContainerWidget(this); }
|
public override Widget Clone() { return new ContainerWidget(this); }
|
||||||
public Func<KeyInput, bool> OnKeyPress = _ => false;
|
public Func<KeyInput, bool> OnKeyPress = _ => false;
|
||||||
public override bool HandleKeyPress(KeyInput e) { return OnKeyPress(e); }
|
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>
|
public class WidgetArgs : Dictionary<string, object>
|
||||||
|
|||||||
Reference in New Issue
Block a user