Closed kstange closed 1 year ago
I'm at work so can't really test it, but I'm curious about something. I always had the impression that SetAllPoints
accepted any object as a relative object, including the parent. If that's not the case and passing the parent causes an error, I'll have to adjust my logic for that. Could you try:
if SetAllPoints then
Region:SetAllPoints(Button)
else
and
if SetAllPoints then
Region:SetAllPoints()
else
Actually, this should only occur if the object calling the method or the object being passed as a relative object is invalid. Eg, calling it on or passing a FontObject. Can you test to see the object type of Region
and Button
when the error occurs? It would also help to know which region is being skinned when the error occurs.
@kstange /poke
Hey, sorry. I'll take a look soon. I haven't gotten to sit down at my PC yet today.
No problem. Wasn't sure if you'd seen my updates.
Does this mean we will be able to skin the ugly blizzard action bars soon? :O
Does this mean we will be able to skin the ugly blizzard action bars soon? :O
@GeekAndProud Yes. I already have a working addon, just waiting for Curse to approve it!
@StormFX finally got to dig into this again. From my testing Anchor is (almost) always coming up as nil and Button is not a Frame, so GetObjectType() is not defined. It appears to be a table that looks like this:
Looking some more at this, Anchor is sometimes Icon, but it's mostly nil. After this code:
Anchor = (Anchor and Regions) and Regions[Anchor]
If Anchor started as nil, then it remains nil after that. When it's Icon, after this line, Anchor ends up being a table.
Regions (assigned from Button.__Regions) seems to always be a table.
Button is always defined and is always a table.
Further analysis:
In Hook_UpdateButtonArt()
, Button is still a CheckButton. I think what is happening here is SkinTexture()
is getting called with the wrong arguments:
It's called as:
SkinTexture("Pushed", Pushed, Skin.Pushed, Button, Button.__MSQ_PushedColor, GetScale(Button))
However the function defintiion is:
Core.SkinTexture(Layer, Region, Button, Skin, Color, xScale, yScale)
Skin.Pushed and Button should be swapped:
SkinTexture("Pushed", Pushed, Button, Skin.Pushed, Button.__MSQ_PushedColor, GetScale(Button))
After this change, the LUA error is gone.
That makes sense. When testing, I had a similar typo with one of the other functions. I must have spaced off checking UpdateArt
. It'll be fixed in the next build.
The perils of languages without strict type checking, I guess! Thanks!
Also, the perils of typing while sleepy. :P
@StormFX I noticed in your commit you switched to xScale, yScale parameters instead of getScale(Button) but they are not defined in the scope of the function.
I fixed it a few commits later. :p
Ah, yep, I see it in commit 92e15c2. Thanks again.
Game Flavor
Retail
Game Version
10.0.0
Add-On Version
10.0.0
Description
With my addon Masque Blizz Bars, when adding the buttons from the system Action Bars, I get the indicated error. This error goes away if I change the following code:
to:
I haven't been able to detect any visual differences regardless of this error.
Error Message
Steps to Reproduce
No response
Screenshots
No response
Notes
I apologize if trying to skin the Blizzard action bars is something you don't want to support and I'm being a pest! :P