Ok, so I bought the WoW Programming book the other day, and I'm reading through it working on the BagBuddy addon that it walks you through and I'm having some issues.
Code:
-- Create the filter buttons
self.filters = {}
for idx=0, 5 do
button = CreateFrame("CheckButton", "BagBuddy_Filter" .. idx, self, "BagBuddyFilterTemplate")
SetItemButtonTexture(button, "Interface\\Icons\\INV_Misc_Gem_Pearl_03")
self.filters[idx] = button
if idx == 0 then
button:SetPoint("BOTTOMLEFT", 40, 200)
else
button:SetPoint("TOPLEFT", self.filters[idx-1], "TOPRIGHT", 12, 0)
end
button.icon:SetVertexColor(GetItemQualityColor(idx))
button:SetChecked(false)
button.quality = idx
button.glow:Hide()
end
self.filters[-1] = self.filters[0]
Is the code thats causing me problems, more specifically this line (I think lol)
Code:
SetItemButtonTexture(button, "Interface\\Icons\\INV_Misc_Gem_Pearl_03")
the LUA error im getting in game:
Message: Interface\FrameXML\ItemButtonTemplate.lua:46: attempt to index field '?' (a nil value)
Time: Tue Jun 15 21:31:56 2010
Count: 1
Stack: Interface\FrameXML\ItemButtonTemplate.lua:46: in function `SetItemButtonTexture'
Interface\AddOns\BagBuddy\BagBuddy.lua:22: in function <Interface\AddOns\BagBuddy\BagBuddy.lua:1>
Locals: button = BagBuddy_Filter0 {
0 = <userdata>
}
texture = "Interface\Icons\INV_Misc_Gem_Pearl_03"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "IconTexture"
(*temporary) = "attempt to index field '?' (a nil value)"
|
edit: solved my problem, I made a typo in my xml file >.> Template is hard word to spell apparently