Fix being able to click through some areas of the chrome#21593
Fix being able to click through some areas of the chrome#21593PunkPun merged 2 commits intoOpenRA:bleedfrom
Conversation
…mouse cursor cannot click through it
…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.
| { | ||
| ClickThrough = other.ClickThrough; | ||
| IgnoreMouseOver = true; | ||
| } |
There was a problem hiding this comment.
this feels like it's going to produce countless regressions
There was a problem hiding this comment.
I think this was the only place where ClickThrough was used on a ContainerWidget.
There was a problem hiding this comment.
To observe this change you need to have set ClickThrough: false and clone it because it's a template for something. That's not going to be a common case.
I could only find a handful of locations with this combo - and it feels like a bugfix for all of them to me.
OpenRA/mods/cnc/chrome/ingame.yaml
Lines 1207 to 1212 in a44e956
OpenRA/mods/d2k/chrome/ingame-player.yaml
Lines 477 to 482 in a44e956
OpenRA/mods/ra/chrome/ingame-player.yaml
Lines 434 to 441 in a44e956
OpenRA/mods/ts/chrome/ingame-player.yaml
Lines 477 to 483 in a44e956
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
ClickThroughset tofalserevealed that there is a bug with the cloning logic forContainerWidget. It simply did not copy theClickThroughfield and it was alwaystruefor cloned widgets. So the value in YAML was lost when the template was cloned.Before:



After:


