From fee04a23254d7ad6f81d2917c76cea3a51b682fb Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Mon, 17 Jun 2013 02:30:59 +0200 Subject: [PATCH] Query uncached items to make sure the texture is displayed --- Config.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Config.lua b/Config.lua index 841a222..481d3bc 100644 --- a/Config.lua +++ b/Config.lua @@ -365,12 +365,12 @@ FilterPanel:SetScript('OnShow', function(self) local Texture = Button:CreateTexture(nil, 'ARTWORK') Texture:SetAllPoints() - Texture:SetTexture(select(10, GetItemInfo(item))) Button:SetScript('OnClick', FilterItemOnClick) Button:SetScript('OnEnter', FilterItemOnEnter) Button:SetScript('OnLeave', GameTooltip_Hide) + Button.Texture = Texture Button.questID = quest Button.itemID = item @@ -378,6 +378,17 @@ FilterPanel:SetScript('OnShow', function(self) end end + local queryItems + for item, Button in pairs(filterItems) do + local _, _, _, _, _, _, _, _, _, textureFile = GetItemInfo(item) + if(textureFile) then + Button.Texture:SetTexture(textureFile) + elseif(not queryItems) then + self:RegisterEvent('GET_ITEM_INFO_RECEIVED') + queryItems = true + end + end + local index = 1 local width = FilterBounds:GetWidth() local cols = math.floor((width > 0 and width or 591) / 36) @@ -388,6 +399,10 @@ FilterPanel:SetScript('OnShow', function(self) index = index + 1 end + + if(not queryItems) then + self:UnregisterEvent('GET_ITEM_INFO_RECEIVED') + end end UpdateFilterBox() @@ -416,6 +431,12 @@ FilterPanel:SetScript('OnShow', function(self) self:SetScript('OnShow', nil) end) +FilterPanel:HookScript('OnEvent', function(self, event) + if(event == 'GET_ITEM_INFO_RECEIVED') then + UpdateFilterBox() + end +end) + InterfaceOptions_AddCategory(Panel) InterfaceOptions_AddCategory(FilterPanel) -- 1.7.9.5