1. #1

    Problem with a piece of LUA:

    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?

  2. #2
    Deleted
    Check your GetChildren returns. Maybe the nameplate layout changed.

  3. #3
    Quote Originally Posted by Treeston View Post
    Check your GetChildren returns. Maybe the nameplate layout changed.
    Essentially I was hoping someone would just be able to tell me what to change. >.<

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •