From 444c02a498294ba6fb86409c5da5b3c9f88c036e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 10 May 2015 12:33:17 +0100 Subject: [PATCH] Add ClickThrough property to ContainerWidget. --- OpenRA.Game/Widgets/Widget.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 39bd0e3415..9154244b39 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -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 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