I need some help with 1.9 changes
Hi
I made a small addon for myself that tracks the number of the X item I have in my inventory. I recently tested it on the testrealms and it doesn't work anymore. So I'm wondering. How do I get the count of the X item and return it to a text after 1.9? thx |
function UpdateTest()
local TestR = 0; local TestRI = 0; local tooltip = getglobal("TestTooltip"); for bag=4, 0, -1 do local size = GetContainerNumSlots(bag); if (size > 0) then for slot=1, size, 1 do local texture, itemCount = GetContainerItemInfo(bag, slot); if (itemCount) then local itemName = nil; tooltip:SetBagItem(bag, slot); local ttext = getglobal("TestTextLeft1"); if (ttext and ttext:IsVisible() and ttext:GetText() ~= nil) then itemName = ttext:GetText(); if (itemName ~= nil and itemName == ( R1 ) and UnitLevel("Player")>50 and UnitLevel("Player")<60) then TestR = Test+ itemCount; TestText:SetText(TestR); That is a basic view of how my code looks like right now. Anyone have a idea why that won't work on the test realm? |
Total shot in the dark but try adding the line in bold:
if (itemCount) then local itemName = nil; tooltip:SetOwner(this) tooltip:SetBagItem(bag, slot); local ttext = getglobal("TestTextLeft1"); I didn't follow the discussion on IRC but I seem to recall something about tooltips not working well if a SetOwner didn't work, or something like that. IsVisible was mentioned in there also. Sorry that's not much information. |
That solved the problem :) Thx very much m8 :D
|
Oh from http://forums.worldofwarcraft.com/th...p=1#post270816
Quote:
I think that's the more correct fix than setting owner (which has a SetPoint and stuff involved which can make the process take longer) |
Looks better to use that one yes. Well thx again :) Nice link too btw.
|
All times are GMT -6. The time now is 10:41 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI