Merge pull request #5972 from pchote/new-ra-ui
Closes #2394 Closes #2385 Closes #4980 Closes #5108
This commit is contained in:
@@ -30,7 +30,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public override bool HandleMouseInput(MouseInput mi)
|
||||
{
|
||||
if (ClickThrough || !Bounds.Contains(mi.Location))
|
||||
if (ClickThrough || !RenderBounds.Contains(mi.Location))
|
||||
return false;
|
||||
|
||||
if (!Draggable || moving && (!TakeMouseFocus(mi) || mi.Button != MouseButton.Left))
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public string ImageCollection = "";
|
||||
public string ImageName = "";
|
||||
public bool ClickThrough = true;
|
||||
public Func<string> GetImageName;
|
||||
public Func<string> GetImageCollection;
|
||||
|
||||
@@ -29,6 +30,7 @@ namespace OpenRA.Widgets
|
||||
protected ImageWidget(ImageWidget other)
|
||||
: base(other)
|
||||
{
|
||||
ClickThrough = other.ClickThrough;
|
||||
ImageName = other.ImageName;
|
||||
GetImageName = other.GetImageName;
|
||||
ImageCollection = other.ImageCollection;
|
||||
@@ -48,5 +50,10 @@ namespace OpenRA.Widgets
|
||||
|
||||
WidgetUtils.DrawRGBA(sprite, RenderOrigin);
|
||||
}
|
||||
|
||||
public override bool HandleMouseInput(MouseInput mi)
|
||||
{
|
||||
return !ClickThrough && RenderBounds.Contains(mi.Location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
IsVisible = widget.IsVisible;
|
||||
IgnoreChildMouseOver = widget.IgnoreChildMouseOver;
|
||||
IgnoreMouseOver = widget.IgnoreMouseOver;
|
||||
|
||||
foreach (var child in widget.Children)
|
||||
AddChild(child.Clone());
|
||||
|
||||
Reference in New Issue
Block a user