SetBackdropBorderColor removed in 9.0?
Hello,
While testing one of my addons on the PTR server, I got this error: Code:
attempt to call method 'SetBackdropBorderColor' (a nil value) Code:
<Scripts> Thanks. |
Might be related to this ... https://us.forums.blizzard.com/en/wo...beta/586355/11
"One of the major changes in 9.0 is a change to SetBackdrop. The TL/DR, on live, 100% of frames support backdrops, whether they are used or not. 1000s of frames between every addon and default UI, even frames that never see such as event frames have backdrops. UI team realized this is a serious performance issue. so effective in 9.0, no frames have backdrops unless the addon imports/inherits the backdrop template. this means addons that aren’t importing them now throw nil errors with method “Setbackdrop”. This issue affects a large number of addons." |
Thank you very much.
|
Quote:
|
Quote:
Retail PTR is showing as 8.3.7 to me .. so I assume they are talking about the Beta which has the Backdrop changes in place. |
Sorry, I'm talking about the beta (9.x).
|
How does one import or inherit the SetBackdrop template? Preferably in Lua. I dislike XML.
|
Code:
local f = CreateFrame("Frame", nil, self, BackdropTemplateMixin and "BackdropTemplate") Then use as normal: Code:
f:SetBackdrop({ ... }) |
Cool, thanks. Do the mixin and template exist on 8.3.x? I'm guessing no.
|
Quote:
https://www.townlong-yak.com/framexml/beta Backdrop.lua / Backdrop.xml |
Using:
Code:
BackdropTemplateMixin and "BackdropTemplate" |
I don't understand how could I apply alpha to a texture/background using this new syntax:
Code:
f.Backdrop = _G[name.."Backdrop"] or CreateFrame("Frame", name.."Backdrop", f, "BackdropTemplate") |
Same as normal. The Mixin that is applied when using the template applies all the pre 9x backdrop methods to the frame. Nothing really changes once you've inherited the template.
Lua Code:
Example |
Quote:
Thank you very much :) |
Quote:
As I am actually in the process of update my addons to 9.x, I would like some of them to work in Classic. The problem is many of my frames are defined in XML, and of course inherits="BackdropTemplate" raises an error in Classic. So, if Classic will not use BackdropTemplate, is there a way to dynamically modify an inheritance defined in XML? Thanks. |
Test and add a backdrop frame in the OnLoad script:
This adds an extra frame for the backdrop rather than just inheriting the template. Code:
<Frame> |
Nice trick, thank you :)
|
Once again, not mine. I don't have beta access.
This would need to add some "pass-through" methods to the parent frame if you are modifying the backdrop during play and want to maintain the single code base for retail and classic. |
Adding this since it's probably useful:
If you want to add a backdrop to a frame you don't control the creation of (e.g. from another addon), you can mix in the mixin: Lua Code:
Then you should be able to use :SetBackdrop and the likes on that frame. |
Quote:
Now I just have to use this code on OnLoad of my old frames, without inherits="BackdropTemplate" and it works on both 8.x and 9.0 versions: Code:
---------------------------------- testing WoW version |
All times are GMT -6. The time now is 02:03 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI