Code:
Message: Interface\AddOns\sUnitframes\sUnitframes.lua:303: attempt to call method 'SetStatusBarTexture' (a nil value)
Time: 11/29/12 00:03:49
Count: 2
Stack: Interface\AddOns\sUnitframes\sUnitframes.lua:303: in function <Interface\AddOns\sUnitframes\sUnitframes.lua:299>
Interface\AddOns\sUnitframes\sUnitframes.lua:316: in function <Interface\AddOns\sUnitframes\sUnitframes.lua:311>
Interface\AddOns\sUnitframes\sUnitframes.lua:324: in function <Interface\AddOns\sUnitframes\sUnitframes.lua:321>
What I'm using:
Code:
local numChildren = -1;
local handledNameplates = {};
local STATUSBAR_TEXTURE_PATH = "Interface\\Textures\\UI-StatusBar.blp"; --Set the new statusbar texture path
local HPBORDER_TEXTURE_PATH = "Interface\\Textures\\Nameplate-Border.blp";
local CBBORDER_TEXTURE_PATH = "";
local function SkinPlate(frame)
local healthBar, castBar = frame:GetChildren();
local _, hpBorder = frame:GetRegions()
local _, cbBorder = castBar:GetRegions()
healthBar:SetStatusBarTexture(STATUSBAR_TEXTURE_PATH);
castBar:SetStatusBarTexture(STATUSBAR_TEXTURE_PATH);
hpBorder:SetTexture(HPBORDER_TEXTURE_PATH);
cbBorder:SetTexture(CBBORDER_TEXTURE_PATH);
handledNameplates[frame:GetName()] = true;
end
local function HookFrames(...)
for index = 1, select('#', ...) do
local frame = select(index, ...);
if(not handledNameplates[frame:GetName()] and (frame:GetName() and frame:GetName():find("NamePlate%d"))) then
SkinPlate(frame);
end
end
end
CreateFrame('Frame'):SetScript('OnUpdate', function(self, elapsed)
if(WorldFrame:GetNumChildren() ~= numChildren) then
numChildren = WorldFrame:GetNumChildren();
HookFrames(WorldFrame:GetChildren());
end
end)
What's changed with 5.1 to break SetStatusBarTexture?