http://www.wowwiki.com/Widget_API
The widget API page lists what you can do to xml elements from within the mod.
For instance, consider that you would like to change the "parent" field of the DummyFrame frame. How would you proceed to accomplish that from the LUA code, in general level ?
|
from the wiki: Frame:SetParent(parent or "parentName") - Set the parent for this frame - New in 1700.
How would I proceed in obtaining the path or file name of the potrait used by the current target ?
|
The portrait is constructed deeper in the UI than we have access to. It does a really thorough job of it so definitely something better left to the game's C code. While it may exists as a path/file someplace, as far as our end of the UI is concerned it doesn't. We can however use it with SetPortraitTexture(texture,"unit"). ie, SetPortraitTexture(MyModsTargetTexture,"target")
Can you "save" the portrait for future use? Probably not. There is no "filename" for a portrait texture and there is no :GetTexture for a generic texture. Total guessing here: It's possible this is drawn in many layers without a final "filename" so a :GetTexture if it existed wouldn't help. Probably icons are the same way. When a texture is applied and some other texture adds with alphaMode="ADD", it doesn't keep two copies of textures so there's nothing meaningful :GetTexture could return. The highlights could be adding and subtracting themselves to whatever is there. Again it's all my speculation so don't take it as gospel or anything.
On portraits, one of my mods is a target history mod that moves targets down like a stack. To keep the portraits around for a long time, instead of redrawing the portrait into the next box, it moves the frame itself.
btw not every aspect of xml can be accessed later (like :GetTexture). Stuff like setting fonts and getting the color of a fontstring are pretty recent. But if you run across something you need that's missing, sometimes a post on the official wow ui forums will get the ball rolling. Perhaps :GetTexture is doable. 1.7 had an enormous amount of stuff added to change xml bits.