Thread Tools Display Modes
07-03-09, 01:16 PM   #1
Rhamses
A Theradrim Guardian
Join Date: Jun 2009
Posts: 61
Icon texture instead of box

I am working on an addon that gices a warning to drain souls. I am pulling some different code together.

I have
function ExecuteWarning_OnLoad()
ExecuteWarning_BuffFrame:Show();
ExecuteWarning_BuffFrame:SetAttribute('type', 'spell')
ExecuteWarning_BuffFrame:SetAttribute('spell', "Drain Soul")
getglobal(ExecuteWarning_BuffFrame:GetName().."_Text"):SetText( "Loaded!" );.

This allows me to take the previous text warning and turn it into a button that can be clicked to drain soul.

I have found the physical dimension in the XML file.

If I wanted to have a Soul Shard icon instead of the box, how do I change the texture? If it is a root path and you do not know it you can write the first part Interface/*** and I will hunt it out.

When I try to change the texture in xml or lua I just get errors. 8 (

Rhamses
 
07-03-09, 01:39 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
If you find the spellID/itemID from wowhead for the soul shard item and then use GetItemInfo to get the information you will be able to get the icon file used for that item.

http://www.wowhead.com/?item=6265
http://www.wowwiki.com/API_GetItemInfo

This means that 6265 is the itemID so using the following command will grab the icon path for you to use as a texture file name.

itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount,
itemEquipLoc, itemTexture = GetItemInfo(itemID)

To make things easier because you may not need the other info you can just do this.

itemTexture = select(10,GetItemInfo(itemID))

This will select the 10th item in the return list from that function.
__________________


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
 
07-03-09, 04:46 PM   #3
Rhamses
A Theradrim Guardian
Join Date: Jun 2009
Posts: 61
Oh wow, thanks! You all are doing a great job teaching a man to fish

Rhamses
 
07-03-09, 04:56 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Rofl, it taught me well a few months back when I was learning

My first addon was written in March and it took me a while to figure it out
__________________


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
 
07-03-09, 05:25 PM   #5
Rhamses
A Theradrim Guardian
Join Date: Jun 2009
Posts: 61
oops, that fish got away.

I may have put the code in the wrong place. I do not get an errorr, but I am unable to change the frame from a simple box. In the lua code I have

if (UnitName("target") == nil) then
ExecuteWarning_BuffFrame:SetAttribute('itemTexture' , 'select(10,GetItemInfo(6265))')
numShards = GetItemCount("Soul Shard");

ExecuteWarning_BuffFrame:SetBackdropColor( 1, 1, 1, 1 );
getglobal(ExecuteWarning_BuffFrame:GetName().."_Text"):SetText( numShards .." / ".. maxShards );

I have tried to place the same command ('Item...) in the on load and it does not change either. My guess is that the XML file called "secure handler is over-riding the lua? In the xml I find

- <Frame name="ExecuteWarning_secureFrames" hidden="true" virtual="true" inherits="SecureActionButtonTemplate" parent="UIParent">
- <Size>
<AbsDimension x="80" y="30" />
</Size>
- <Backdrop bgFile="Interface/Tooltips/UI-Tooltip-Background" edgeFile="Interface/Tooltips/UI-Tooltip-Border" tile="true">
- <BackgroundInsets>
<AbsInset left="4" right="4" top="4" bottom="4" />
</BackgroundInsets>
- <TileSize>
<AbsValue val="16" />
</TileSize>
- <EdgeSize>
<AbsValue val="16" />
</EdgeSize>
</Backdrop>


As well as
- <Button name="ExecuteWarning_BuffFrame" hidden="true" inherits="ExecuteWarning_secureFrames" enableMouse="true" movable="true">
 
07-03-09, 06:24 PM   #6
Rhamses
A Theradrim Guardian
Join Date: Jun 2009
Posts: 61
wow, my head is really spinning now. Maybe, I should toss out this "secure Frame" file and try to rewrite what I think it is doing in the lua files I have played with. Learning one language is hard enough without bouncing back and forth

Art

Last edited by Rhamses : 07-03-09 at 06:35 PM.
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Developer Chat » Icon texture instead of box


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