[7.3] MaskTexture affects multiple unrelated textures
I'm using an XML template for my action buttons that contains this MaskTexture object:
Lua Code:
This template is used to create button clusters of 4, where 3/4 buttons should have a different mask texture set to them, depending on their orientation. This is done using 12 different mask textures (since rotation by texture coords doesn't seem to work). Compiled into one image below: By setting the new texture to the mask in Lua like so: Lua Code:
This is where this strange bug happens, where updating the texture for one mask affects other masks inherited from the same template. This might be related to the fact that these buttons are all created at the same time, and it ends up incorrectly linking one mask to multiple icons instead of linking each individual mask to each individual icon. Likewise, creating masks in pure Lua and setting child keys manually causes the same problems. Where the end result is supposed to look something like this: ...it instead ends up looking like this: As you can see in this screenshot, all L1L2 buttons oriented to the left have the correct mask, one single L2 button has the correct mask (these two masks are the only 2/12 textures that are even present in this screenshot). Everything else is wrong. I've confirmed that the code to handle all this is correct by dumping mask:GetTexture() for different buttons, which indeed returns the correct texture paths. Here's a video of this issue in action when the orientation of a cluster is updated. |
1 Attachment(s)
I put together a little addon that demonstrates this bug by using two separate mask textures to loop through these 12 textures at different intervals. They both update whenever the first mask updates.
|
I do a test with time delay(forgive me using the Scorpio to skip the delay code), with the second frame and mask created after 2 sec, and third mask created after 4 sec.
For the first time, all the mask's icon use the same spell texture : Lua Code:
When the second is created, the first mask's display is also changed, but GetTexture will return the old one. and when the third mask is created, the first and the second mask also changed. But when I use different spell for the three mask : Lua Code:
All works fine. Looks like the mask is attached the texture file directly. Take another interesting example : Lua Code:
The spell and ability's mask will take the same display(should they in the same texture file?), and the xp and inv won't. All tests are done in 7.2.5, but I think it may be the same in the PTR. Since there is no rules for the bug, maybe using separately texture files can avoid it. |
This bug might be related to traditional texture paths. Using texture database IDs doesn't seem to cause these issues.
|
In the second example, if replace the 135848 to 136116, the bug still existed. Since it's not a random issue, the mechanism of the masking would be the problem.
|
I guess my conclusion was a classic case of false causlity. In the original post, there are at least 2 different masks present for all the small buttons and another mask for the big buttons. No Lua code touches the large round masks because the template has that mask texture by default, so they're unaffected by the bug.
|
Looks like this bug was fixed in build 24793!
|
This is really awesome btw. :-)
|
I poked a dev about this. Didn't i mentioned it's gonna be fixed? Maybe it was in another thread.
|
You did. I read it today somewhere.
|
All times are GMT -6. The time now is 02:52 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI