View Single Post
01-13-10, 12:18 PM   #53
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Yeah, the macro lists all your buffs and what image files are used for the icons. However, it would only show the name and not the image itself. But it is a step in the direction.

Macro Code:
Code:
/script function m(s) DEFAULT_CHAT_FRAME:AddMessage(s); end for i=1,16 do s=UnitBuff("target", i); if(s) then m("B "..i..": "..s); end s=UnitDebuff("target", i); if(s) then m("D "..i..": "..s); end end
Lua Code:
Code:
function m(s) 
  DEFAULT_CHAT_FRAME:AddMessage(s); 
end 
for i=1,16 
  do s=UnitBuff("target", i); 
  if(s) then 
    m("B "..i..": "..s); 
  end s=UnitDebuff("target", i); 
  if(s) then 
    m("D "..i..": "..s); 
  end 
end
And as it shows on that page the following is what you will see.

B 1: Interface\Icons\Spell_Holy_WordFortitude
D 1: Interface\Icons\Ability_Gouge
B 2: Interface\Icons\INV_Jewelry_Talisman_07

B and D are values denoting they are a buff or debuff aura. The numbers are which of your buff and debuff lists it is. And then finally what image file it uses to display it.

In your example though you shouldn't need to do all that as your addon is looking for a specific buff and whether it is active or not.

If you look at this page you will see that you can retrieve more information from that UnitBuff function. The icon variable shown is one we would need and would return the same as that macro/function code I show above but for just the one buff and not for all 40 available.

http://www.wowwiki.com/API_UnitBuff

Once you have that information your next step is to figure out how to get the actual icon to display with your message and not the filename The following are pages that would be useful for this aspect. These two together will allow you to create a texture object on your visual frame and then set it with a texture file to use.

http://www.wowwiki.com/API_Frame_CreateTexture
http://www.wowwiki.com/API_Texture_SetTexture

Good Luck
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote