I have an addon that Im writing and part of it checks for missing gems; well attempting to. Basically, I have a hidden tooltip and I populate it with the item I want to scan, that seems to work fine. I then scan that populated tooptip with GetTexture() to return the path to the textures that the tooltip uses. The ones Im interested in are in the code snippet below and the code actually finds them. However, where im having issues is it doesn't seem to clear old data. :ClearLines() is supposed to do that but doesnt seem to be working or Im not using it in the correct fashion. So here is my code:
function TCoL_ScoreUs_GemCheck()
local gemModifier = 10 --missing gem subtraction modifier
--DEFAULT_CHAT_FRAME:AddMessage("TCoL_ScoreUs Debug: itemID: " .. TCoL_itemID)
TCoL_ScoreUs_Tooltip:ClearLines();
TCoL_ScoreUs_Tooltip:SetHyperlink("item:"..TCoL_itemID)
for textureCount=1, 10 do
local socketCheck = getglobal("TCoL_ScoreUs_TooltipTexture"..textureCount):GetTexture();
if (socketCheck) and (socketCheck == "Interface\\ItemSocketingFrame\\UI-EmptySocket-Meta") then TCoL_socketCount = TCoL_socketCount + 1 end
if (socketCheck) and (socketCheck == "Interface\\ItemSocketingFrame\\UI-EmptySocket-Blue") then TCoL_socketCount = TCoL_socketCount + 1 end
if (socketCheck) and (socketCheck == "Interface\\ItemSocketingFrame\\UI-EmptySocket-Red") then TCoL_socketCount = TCoL_socketCount + 1 end
if (socketCheck) and (socketCheck == "Interface\\ItemSocketingFrame\\UI-EmptySocket-Yellow") then TCoL_socketCount = TCoL_socketCount + 1 end
if (socketCheck) then DEFAULT_CHAT_FRAME:AddMessage("TCoL_ScoreUs Debug: texture: ".."-"..textureCount.."-" .. socketCheck.."-"..textureCount.."-"..TCoL_itemLink) end
if (socketID) then end --DEFAULT_CHAT_FRAME:AddMessage("TCoL_ScoreUs Debug: texture: " .. socketID) end
socketCheck=""
end
end
The issue is I seem to retain data. If I scan my head piece which has 2 gen slot, i can then scan a piece that has no slots but it still shows the same info from the head piece, but the proper piece has been populated in the tooltip window, at least that's what I think my code is doing, debug line in my code show the piece correctly.
What am i missing?|||You're missing the right forum, that's for starters.
No comments:
Post a Comment