Fix being able to click through some areas of the production palette in RA

The production palette in RA is assembled from a foreground and a background. The foreground provides most of the visible graphics (such as the metallic chrome) but it has to let clicks go through to the production icons. The background is the one that has to stop the clicks then but it was not wide enough (because the art is only for the background behind production icons and not the whole chrome). Trying to fix that by wrapping the image in wider container that has `ClickThrough` set to `false` revealed that there is a bug with the cloning logic for `ContainerWidget`. It simply did not copy the `ClickThrough` field and it was always `true` for cloned widgets. So the value in YAML was lost when the template was cloned.
This commit is contained in:
Ivaylo Draganov
2024-09-27 16:56:40 +03:00
committed by Gustas
parent 4e9ef7a334
commit 806f0fd270
2 changed files with 15 additions and 7 deletions

View File

@@ -626,7 +626,11 @@ namespace OpenRA.Widgets
public ContainerWidget() { IgnoreMouseOver = true; }
public ContainerWidget(ContainerWidget other)
: base(other) { IgnoreMouseOver = true; }
: base(other)
{
ClickThrough = other.ClickThrough;
IgnoreMouseOver = true;
}
public override string GetCursor(int2 pos) { return null; }
public override Widget Clone() { return new ContainerWidget(this); }