useful Macro for checking UI-Items
Hi there!
Here is a useful Macro, for getting the name of a UI frame: /script DEFAULT_CHAT_FRAME:AddMessage( GetMouseFocus():GetName() ); Just create that Macro and put it into the actionbar. Point your mousecursor over a particular frame an press the actionbars number for that Macro. The frames name will be post into the chatframe. But now I have got a question: I need a Macro for getting the texturepath from the texture my mouse is over. The following Macro doesn't work but I don't know why: /script DEFAULT_CHAT_FRAME:AddMessage( GetMouseFocus():GetTexture() ); All I found out so far is that 'GetTexture()' seems to not work with 'GetMouseFocus()'. But why? The following works: /script DEFAULT_CHAT_FRAME:AddMessage( ActionButton1Icon:GetTexture() ); This Macro gets the texturepath of the icon in actionbar1. I hope that Macro helps you and someone can help me! ;) greetings, nehegeb |
GetTexture() only works for texture objects. Frame objects do not use SetTexture(). They have a background image and use SetBackdrop() instead. So, if your GetTexture() doesn't work, use GetBackdrop().
|
Your first macro actually fails because GetMouseFocus() does not return ActionButton1Icon. It returns ActionButton1.
GetMouseFocus() only returns the top-most mouse-enabled frame. It doesn't return non-frame UI objects (like textures or font strings). It doesn't return frames that aren't mouse-enabled. And it only returns the mouse-enabled frame with the highest frame level/strata. Since ActionButton1Icon is a texture, not a frame, you won't get a pointer to it from GetMouseFocus(). However, Seerah's solution won't work for your particular case, because ActionButton1Icon is a child of what GetMouseFocus() does return (ActionButton1), not its backdrop. There isn't really a generic solution that will work to get all visible textures. If you're only interested in action button icon textures, the following would work: /print _G[GetMouseFocus():GetName() .. "Icon"]:GetTexture() Breaking that down:
Note that using this macro on objects that don't have a name will cause an error. Using it on objects that do have a name, but don't have a corresponding "nameIcon" object, will also cause an error. |
Thanks for your rapid answers!
@Seerah: Sadly your tip with 'GetBackdrop()' doesnt work. That would have been great! @Phanx: Thanks for your infos. They will help me further! But I think, I didn't explain correctly what I need... ...in general I need a Macro that tells me, what texturepath a visible texture on the UI has got, so that I can use exactly this texture for my addons. At first it would really help me, if I could get just the path of the texture on the hightest level/strata. So maybe the thing with 'GetMouseFocus()' could work. I don't only need just the Icons. That was just an example for what worked (in my first post). In many cases it's really just the backdrop of a frame. Maybe what I want isn't possible for a single Macro, so an Addon also would do it, if it exists. Otherwise I have to break my workings on my almost finished Addon and build another one that gets me my needed textures. :D The perfect solution would be a Tooltip next to the mousecursor, that shows me all the UI textures and their paths from what my mouse is pointing at (from all strata). btw. my first macro is helpful, if you want to know how a particular frame is called for maybe anchoring another frame to this one. ;) |
FluidFrames ???
Doesn't FluidFrames do what ya want? :confused:
|
No, not really. This addon moves frames in the UI but I need the textures (texturepaths) that are used for those frames to use them in my own addons.
|
Quote:
http://wowcompares.com/ Otherwise, you're going to run into tons of issues trying to use macros to find textures. Some textures are Backdrops, while others are StatusBarTextures, and others are Texture regions that are either unnamed or don't follow any consistent naming pattern. There's pretty much no way to write a macro that will catch all of those cases and correctly identify which of a frame's child Texture regions you want. |
Thank you, Phanx! Your link is quite useful.
Checking those files will take a while, but it's a start! ;) Edith asks: Is there a site or program or whatever for seeing all the WoW textures with their paths? Or where do other addon-coder get their textures from (if they are not self-made)? |
if you need to see textures
try this : http://us.blizzard.com/support/artic...rticleId=21466 for converting BLP's to PNG i am using this litle program,maybe bit old but working very good for me. http://www.wowinterface.com/download...7-BLP2PNG.html |
Yep, extracting the UI art is a good idea. That will also allow you to extract the UI code (which is what Phanx linked you to, but that site shows you diffs between versions of the game).
There is also this to allow you to browse them online: http://wowprogramming.com/utils/artbrowser (note, on the site I linked above, the path would start with Interface\... followed by the folders/files listed on that page) |
Code:
/run |
Thank you very much for all of your help!
Your links and tips really helped me. Now my addon looks quite cool :D Greetings nehegeb |
/framestack
|
All times are GMT -6. The time now is 05:45 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI