oUF for nameplate creation?
I posted a barebone nameplate setup here:
http://www.wowinterface.com/forums/s...4&postcount=62 Most important are the following three. - nameplate_create when we spawn the frame using a certain style. - unit_added when we show the frame and set the unit of the frame. - unit_removed when we hide the frame and remove the unit. Is this possible with the default oUF core? I need to be able to pass the nameplate base as an anchor frame into the Spawn function. *edit* Wooow. It actually works! Fixed scaling: magic bean: Lua Code:
Not perfect yet though. But it shows that it should be possible. Currently I seem to struggle with the unit update. Nameplates shuffle units quite often and I need a way to tell oUF about the unit change. Hasn't oUF a function to trigger a full update? Sth like UpdateAllElements. If you want to test it here is the code I'm using atm: https://github.com/zorker/rothui/blo...imple/core.lua Units do not update properly and clicking on a unit does not activate the correct unit. |
I think I got it!!! (But it works only out of combat atm. I need a secure way to apply the unit attribute (I think...))
Lua Code:
Full solution (all you need is your own style function) Lua Code:
I either need a spawn that does not need secure environment or I need a way to spawn/change the unit attribute securely. |
I tried adding the following change as a test to the oUF Spawn function:
Lua Code:
This gets rid of the in combat error. But sometimes the health will not update properly. I think that is because going from secure to not secure unitframes is not just removing the template and be done?! Well another issue is that nameplates will pop up during combat. They must be spawnable in combat. Maybe nameplates can be handled like party or raid via secure group header? The current solution works perfectly. Out of combat. :p *edit* I went back to the adjusted oUF spawn because I think it is the only solution. We need to spawn the nameplates without the secure template. From what I can tell the only thing that is missing atm is that UNIT_HEALTH is not updating the target nameplate properly. Hmm yeah...when fighting UNIT_HEALTH fires only for target and oUF is not updating the target nameplate correctly. But I can fix that by doing C_NamePlate.GetNamePlateForUnit("target") and applying the value on postupdate to the corresponding nameplate. Will see how that goes. Imo anything that affects the target unit has to be populated to a corresponding nameplate target unit aswell since it will only fire once. Urgs...the same is also true party/raid units...hmm that sounds messy. No sure if seperating nameplate from other unit frames in two seperate ouf layouts helps with that. *edit* Yes that seems to have fixed all issues. I disabled all unitframes but the nameplate spawn. I only used nameplate unit ids. I spawned them with the adjusted oUF spawn function as a not secure button. So here is my idea for now. 1.) Adjust the oUF spawn function to allow the creation of non secure nameplate units. 2.) Create a seperate layout for nameplates only that does only spawn nameplate units (never use anything else but nameplate1..n as your unit id) The tricky part is that I want to access style function from my oUF unit layout. But I probably can circumvent this by making the layout functions globally available. |
Yeah the UNIT_HEALTH on nameplates work badly. Blizzard registers both UNIT_HEALTH and the frequent one (forgot the name). I'm using the frequent one only on mine.
If you get the OnEvent onevent of the unitframe and change it so it bails out if there's a unit and unit does not match the nameplate, would that fix it? |
I'm currently doing that sticklord is suggesting. Trying to create a seperate spawn function for nameplates.
Currently I get this taint: Lua Code:
Currently trying to get rid of that error. :) *edit* Ok I could just remove the unit watch since we have unit_added and unit_removed for nameples. The error seems to be gone. Lua Code:
This is all I have for nameplate_added and nameplate_removed atm. Works fine. Lua Code:
|
Not sure why but I commented in my unitframes again and everything is working as it should! I now have a template that runs both nameplates and normal unitframes.
http://imgur.com/a/mGgbb It is fucking beautiful!!! Hopefully auras will not cause issues. >_< |
Neat!
Should be easy to add support for nameplates in oUF. |
Created a pull request: https://github.com/oUF-wow/oUF/pull/312
That is all I had to change in oUF to get it working. Hmmm. Yeah of course one could integrate the worker aswell in oUF but not sure if that is really needed since you probably want to keep control over what the events are doing. |
Here is the final result for now. Implementation of auras cause no issues at all.
It is fucking amazing! |
hi, this is great.
it's possible to change font size for debuff? |
Anything on screen is spawned by an oUF style function that you need to define or that you can adjust. Yes, you can do that.
Shot from 5man Blizzard increases the size of boss nameplates by default. |
Quote:
|
There is a so called nameplate base frame. They must adjust the scale of the nameplate base frame for bosses. But it should be easily detectable on UNIT_ADDED.
I already offset the worldframe scale. Otherwise the size of all my nameplates would be off. https://github.com/zorker/rothui/blo.../core.lua#L688 Lua Code:
Nameplates shuffle units constantly. There is no specific nameplate for player or bosses. Any nameplate may be used for any unit. |
This is really cool, looking forward it being implemented in oUF!
|
oUF generated nameplates can't be clicked?
Edit: Hmm, it felt weird at first, maybe I was just missing something, not sure. Just ignore this, will test them later ;) |
Of course they can be clicked! One very important thing though. Your nameplate unitframe must not be clickable! Do not register this for units of type nameplate!
Lua Code:
https://github.com/zorker/rothui/blo...eplate.lua#L17 The nameplate base is clickable, that is all we need. |
Yeah, works fine now. No idea what went wrong when I created a simple test layout with only name text and health bar, guess the anchors were completely wrong and that's why it felt like I couldn't click them.
By the way, any idea why friendly player nameplates are now shown for units with missing health who aren't in my group? I think that's new for 7.1... |
No clue. Still need to update the cvarlist of the nameplates. Not sure if they changed sth.
This is the live 7.0 to PTR 7.1 diff. https://github.com/zorker/rothui/com...76b1ccbee2d4ad Still need to make a new one for 7.1 on live. |
7.1 brought a lot of restrictions to nameplates. None of them affects oUF nameplates. :banana:
|
All times are GMT -6. The time now is 04:13 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI