Reply
Thread Tools Display Modes
Unread 11-25-05, 07:21 AM   #1
Phoenix
A Murloc Raider
 
Phoenix's Avatar
Join Date: Nov 2005
Posts: 4
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
Phoenix is offline   Reply With Quote
Unread 11-28-05, 04:20 AM   #2
Phoenix
A Murloc Raider
 
Phoenix's Avatar
Join Date: Nov 2005
Posts: 4
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?
Phoenix is offline   Reply With Quote
Unread 11-28-05, 10:37 AM   #3
Gello
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 444
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.
Gello is offline   Reply With Quote
Unread 11-28-05, 11:04 AM   #4
Phoenix
A Murloc Raider
 
Phoenix's Avatar
Join Date: Nov 2005
Posts: 4
That solved the problem Thx very much m8
Phoenix is offline   Reply With Quote
Unread 11-28-05, 11:48 AM   #5
Gello
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 444
Oh from http://forums.worldofwarcraft.com/th...p=1#post270816

* NEW - isShown = FontString:IsShown() - Return whether font string is shown (NOTE: FontString IsVisible behaves properly now on hidden tooltips, tooltip scanners need to use IsShown instead !)
Take out the SetOwner and try using IsShown instead of IsVisible.

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)
Gello is offline   Reply With Quote
Unread 11-28-05, 12:16 PM   #6
Phoenix
A Murloc Raider
 
Phoenix's Avatar
Join Date: Nov 2005
Posts: 4
Looks better to use that one yes. Well thx again Nice link too btw.
Phoenix is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Lua/XML Help » I need some help with 1.9 changes

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off