Upgrading old addon for BCC Backdrop change.
I've been trying to get sRaidFrames working on BCC for a bit now, but not being great at LUA I'm having trouble getting the suggestions in other threads about this working.
Since the addon had an outdated Ace3 version I swapped in the most recent version of that first which seems to have worked fine. Then based on this and some of the posts here, I edited the lines with CreateFrame that I could see how to easily, adding the BackdropTemplateMixin and "BackdropTemplate" part, but I'm still seeing these errors Code:
Message: Interface\AddOns\sRaidFrames\sRaidFrames.lua:1451: attempt to call method 'SetBackdrop' (a nil value) Code:
Message: Interface\AddOns\sRaidFrames\sRaidFrames.lua:1705: attempt to call global 'UnitHasVehicleUI' (a nil value) As to not crowd this post with code blocks, here's the code around the first error I'm seeing, but there's more not throwing errors (yet), or ones that I couldn't figure out how to edit looking at examples, so checking the full source is probably best. This code corresponds to Lua Code:
It's line 98 in that which causes the first error, but there are more examples in the full code. Any advice or pointing in the right direction is greatly appreciated. Thanks! |
In every version of the game up to Classic Vanilla, frames were created with a backdrop by default. Since then (Shadowlands/Classic TBC), backdrops are optional and you have to "add" them to your frame(s) if you want one.
This is done by either inheriting the BackdropTemplate when the frame is created or via a Mixin after the frame is created. The template/mixin adds all the regions and methods originaly gained by default like :SetBackdrop(), :SetBackdropColor() etc. The following allows your code to be use in all versions by detecting if the mixin or one of the backdrop methods exist. To add on during creation: Code:
local = CreateFrame("Frame", "name", parent, BackdropTemplateMixin and "BackdropTemplate") After creation. Code:
if not frame.SetBackdrop then |
All times are GMT -6. The time now is 12:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI