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)
Curseforge is down so I can't link there for a download of the code. The full initial commit on my
github repo is the original code, and the current version has the edits I've made. They're just in the sRaidFrames.lua as the above error implies.
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:
[code]
-- Adapts frames created by Secure Headers
function sRaidFrames:CreateUnitFrame(...)
local f = select("#", ...) > 1 and CreateFrame(...) or select(1, ...)
--f:EnableMouse(true)
f:RegisterForClicks("AnyUp")
--f:SetAttribute("allowVehicleTarget", true)
f:HookScript("OnAttributeChanged", sRaidFrames_OnAttributeChanged)
f:SetScript("OnEnter", function(this)
if sRaidFrames:QueryTooltipDisplay(sRaidFrames.opt.UnitTooltipMethod) then
sRaidFrames:UnitTooltip(this)
end
end)
f:SetScript("OnLeave", function(this)
GameTooltip:Hide()
end)
f.title = f:CreateFontString(nil, "ARTWORK")
f.title:SetFontObject(GameFontNormalSmall)
f.title:SetJustifyH("LEFT")
f.auraFrames = {}
for i = 1, 3 do
local auraFrame = CreateFrame("Button", nil, f, BackdropTemplateMixin and "BackdropTemplate")
auraFrame.texture = auraFrame:CreateTexture(nil, "ARTWORK")
auraFrame.texture:SetAllPoints(auraFrame);
auraFrame.count = auraFrame:CreateFontString(nil, "OVERLAY")
auraFrame.count:SetFontObject(GameFontHighlightSmallOutline)
auraFrame.count:SetJustifyH("CENTER")
auraFrame.count:SetPoint("CENTER", auraFrame, "CENTER", 0, 0);
auraFrame:SetScript("OnEnter", function (this)
if sRaidFrames:QueryTooltipDisplay(sRaidFrames.opt.DebuffTooltipMethod) then
GameTooltip:SetOwner(this)
GameTooltip:SetUnitAura(this.unitid, this.auraid, this.filter)
end
end)
auraFrame:SetScript("OnClick", function (this)
if IsAltKeyDown() then
-- TODO: Blacklist
end
end)
auraFrame:SetScript("OnLeave", function(this)
GameTooltip:Hide()
end)
auraFrame:Hide()
local debuffTimer = auraFrame:CreateFontString(nil, "ARTWORK")
debuffTimer:SetFont("Fonts\\FRIZQT__.TTF", 12, "OUTLINE")
debuffTimer.fontsize = 12
debuffTimer:SetTextColor(0.7, 0.7, 0)
debuffTimer:ClearAllPoints()
debuffTimer:SetAllPoints(auraFrame)
tinsert(f.auraFrames, auraFrame)
f["aura"..i] = auraFrame
end
local texture = Media:Fetch("statusbar", self.opt.Texture)
f.hpbar = CreateFrame("StatusBar", nil, f, BackdropTemplateMixin and "BackdropTemplate")
f.hpbar:SetStatusBarTexture(texture)
f.hpbar:SetMinMaxValues(0,100)
f.hpbar:SetValue(0)
f.hpbar.text = f.hpbar:CreateFontString(nil, "ARTWORK")
f.hpbar.text:SetFontObject(GameFontHighlightSmall)
f.hpbar.text:SetJustifyH("CENTER")
local color = self.opt.HealthTextColor
f.hpbar.text:SetTextColor(color.r, color.g, color.b, color.a)
f.mpbar = CreateFrame("StatusBar", nil, f, BackdropTemplateMixin and "BackdropTemplate")
f.mpbar:SetStatusBarTexture(texture)
f.mpbar:SetMinMaxValues(0,100)
f.mpbar:SetValue(0)
f.statustext = f.mpbar:CreateFontString(nil, "ARTWORK")
f.statustext:SetFontObject(GameFontHighlightSmall)
f.statustext:SetJustifyH("CENTER")
--f:ClearAllPoints()
self:SetWHP(f, 80, 34)
self:SetWHP(f.title, f:GetWidth() - 6, 13, "TOPLEFT", f, "TOPLEFT", 3, -3)
self:SetWHP(f.aura1, 13, 13, "TOPRIGHT", f, "TOPRIGHT", -3, -3)
self:SetWHP(f.aura2, 13, 13, "RIGHT", f.aura1, "LEFT", 0, 0)
self:SetWHP(f.aura3, 13, 13, "RIGHT", f.aura2, "LEFT", 0, 0)
self:SetWHP(f.hpbar, f.title:GetWidth(), 12, "TOPLEFT", f.title, "BOTTOMLEFT", 0, 0)
self:SetWHP(f.mpbar, f.title:GetWidth(), 4, "TOPLEFT", f.hpbar, "BOTTOMLEFT", 0, 0)
self:SetWHP(f.hpbar.text, f.hpbar:GetWidth(), f.hpbar:GetHeight(), "CENTER", f.hpbar, "CENTER", 0, 0)
self:SetWHP(f.statustext, f.mpbar:GetWidth(), f.mpbar:GetHeight(), "CENTER", f.mpbar, "CENTER", 0, 0)
f:SetBackdrop({
bgFile = Media:Fetch("background", sRaidFrames.opt.BackgroundTexture),
tile = true,
tileSize = 8,
edgeFile = Media:Fetch("border", sRaidFrames.opt.BorderTexture),
edgeSize = 8,
insets = { left = 2, right = 2, top = 2, bottom = 2 }
})
f:SetBackdropColor(self.opt.BackgroundColor.r, self.opt.BackgroundColor.g, self.opt.BackgroundColor.b, self.opt.BackgroundColor.a)
f:SetBackdropBorderColor(self.opt.BorderColor.r, self.opt.BorderColor.g, self.opt.BorderColor.b, self.opt.BorderColor.a)
f.hpbar.text:SetTextColor(self.opt.HealthTextColor.r, self.opt.HealthTextColor.g, self.opt.HealthTextColor.b, self.opt.HealthTextColor.a)
--f:Hide();
tinsert(self.frames, f)
ShouldUpdateFrameCache = true
ClickCastFrames = ClickCastFrames or {}
ClickCastFrames[f] = true
end[/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!