Thread: HealPrediction
View Single Post
10-09-13, 02:09 AM   #6
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
@Rainrider
I have my own absorbbar module. That's why.

Module
http://code.google.com/p/rothui/sour...otalAbsorb.lua

Create Function
Lua Code:
  1. --total absorb
  2.   func.totalAbsorb = function(self)
  3.     if not self.cfg.totalabsorb or (self.cfg.totalabsorb and not self.cfg.totalabsorb.show) then return end
  4.     local w = self.Health:GetWidth()
  5.     if w == 0 then
  6.       w = self:GetWidth()-24.5-24.5 --raids and party have no width on the health frame for whatever reason, thus use self and subtract the setpoint values
  7.     end
  8.     local absorbBar = CreateFrame("StatusBar", nil, self.Health)
  9.     --new anchorpoint, absorb will now overlay the healthbar from right to left
  10.     absorbBar:SetFrameLevel(self.Health:GetFrameLevel()+1)
  11.     absorbBar:SetPoint("TOPRIGHT", self.Health, 0, 0)
  12.     absorbBar:SetPoint("BOTTOMRIGHT", self.Health, 0, 0)
  13.     absorbBar:SetWidth(w)
  14.     absorbBar:SetStatusBarTexture(self.cfg.totalabsorb.texture)
  15.     absorbBar:SetStatusBarColor(self.cfg.totalabsorb.color.bar.r,self.cfg.totalabsorb.color.bar.g,self.cfg.totalabsorb.color.bar.b,self.cfg.totalabsorb.color.bar.a)    
  16.     absorbBar:SetReverseFill(true)
  17.     -- Register with oUF
  18.     self.TotalAbsorb = absorbBar    
  19.   end

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

Sidenote

I really would have loved to not using a fake statusbar on my orb. The problem is that when setting
Lua Code:
  1. bar:SetOrientation("VERTICAL")
  2. bar:SetReverseFill(true)

The statusbar texture crop is wrong. At least for what I'm needing. It will look like the texture is moving in from the top, not filling top-to-bottom.
I tried to hook the SetTexCoord function call on the statusbar texture to swap some values but it does not fire :/
Funny enough before applying the Smooth module I tried changing the SetTexCoord via the PostUpdate function but when PostUpdate was called (after SetValue) the SetTexCoord on the statusbar texture had not yet been applied. GetTexCoord() always delivered the old value, never the new one. Wierd!
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-09-13 at 06:19 AM.
  Reply With Quote