HealPrediction
How are we supposed to implement the oUF's in-house healprediction element in a layout? My problem is how to position the status bars as obviously the example implementation in the comment in the element itself would simply overlap them if I anchor all of them to self.Health:GetTexture(). In Blizzard's heal prediction implementation the absorb bar is anchored either to the healAbsorb or the otherIncomingHeal, based on whether allIncomingHeal is bigger than the current heal absorb. The oUF's element does not support dynamic anchoring.
Aprat from that, Blizzard's heal prediction seems a bit strange (just from looking at the code, can't test this in-game). They seem to not reduce the amount of incoming heals by the amount of heal absorb (apart from when it would overflow the health bar) and always show the incoming heals even if the heal absorb is greater than them. They do reduce the heal absorb by the amount of incoming heals though and it seems they would display both heal absorb and inc heals overlapped (both textures are anchored to the health statusbar texture). Is this correct? |
This is what I'm doing:
Lua Code:
|
You are not using the healAbsorbBar. The element got updated for 5.4. You also don't need to explicitly set the frame level to that of the health bar as long as it is your bars' parent.
Apart from that, my current implementation is exactly like yours. I just get some strange positioning and can't track it down. I would also like to mimic blizzard's functionality as close as possible, that's why I wonder how they handle the overlapped bars (if I read their code right) and how to anchor the bars dynamically. I could do the latter in PostUpdate with a lot of code repeating from the element's update function, which would be a waste and is a limitation of the element I think, unless I oversee something. So I would like to know how the blizzard implementation behaves and based on that either make my own oUF element for it or use the default one. |
Just found an easy way to see the whole thing in action: Glyph of Life Tap for heal absorb, Overgrown Lilypad for incoming heal and Sacrificial Pact for shield. I'll probably set for creating my own element, based on blizzard's code.
|
This is where you can use PostUpdate, instead of an override function or writing a separate element.
Lua Code:
Lua Code:
|
@Rainrider
I have my own absorbbar module. That's why. Module http://code.google.com/p/rothui/sour...otalAbsorb.lua Create Function Lua Code:
Result: Basically I overlay the healthbar with the absorb bar from right-to-left. The healprediction is underneath. That way when loosing health I can easily see how much of the health lost is covered by a shield. My shield display caps at maxhealth. I see no point in adding absorb bar to the healprediction display. Healprediction fills up health that is lost. Absorbbar shows how much of your health is covered by a shield. My orb uses the same module, just a different create function. http://code.google.com/p/rothui/sour...player.lua#389 Quote:
|
@Freebaser
Oh, I haven't thought about getting the status bar values. I'll also have to offset the healAbsorb and figure out the visibility of the bars when they overlap. Wouldn't it still be better to pass myIncomingHeal, otherIncomingHeal, totalAbsorb, myCurrentHealAbsorb and maxHealth to PostUpdate as this would spare the global calls (don't know if statusbar:GetValue() is a global or something else actually)? |
Ok, that's what I got so far:
PostUpdate: lua Code:
Creation function (or whatever it should be called): lua Code:
Anyone a better idea? Btw, shouldn't the oUF element break the update if maxHealth == 0? |
You can drop the PostUpdate healAbsorbPercent and healAbsorbBar:SetPoint stuff. Use something like this when creating the bar.
Lua Code:
|
self.Health:GetWidth() returns 0 for me on group header units.
|
Quote:
|
Quote:
It appears that local _, maxHealth = health:GetMinMaxValues() is not a save way to retrieve maxHealth as it returns 0 after /reloadui when I apply a heal absorb on me and then target myself. Subsequent targeting seems to return correct values. Wasn't able to reproduce this with UnitHealthMax(unit). My code so far: lua Code:
lua Code:
@zork I also have issues with 0 returns for GetWidth(), I'll open a new thread for it. |
I just do self:GetWidth(). If you have a setpoint on your health that affects the width you just need to substract it.
|
I opened a thread for this at http://www.wowinterface.com/forums/s...ad.php?t=48331
|
All times are GMT -6. The time now is 01:09 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI