Thread: HealPrediction
View Single Post
10-08-13, 09:27 PM   #5
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
This is where you can use PostUpdate, instead of an override function or writing a separate element.

Lua Code:
  1. local function HealPostUpdate = function(hp, unit)
  2.  
  3.     if(hp.absorbBar:GetValue() > 0) then
  4.         hp.absorbBar:ClearAllPoints()
  5.         hp.absorbBar:SetPoint('TOP')
  6.         hp.absorbBar:SetPoint('BOTTOM')
  7.  
  8.         if(hp.healAbsorbBar:GetValue() > 0) then
  9.             hp.absorbBar:SetPoint('LEFT', hp.healAbsorbBar:GetStatusBarTexture(), 'RIGHT')
  10.         else
  11.             hp.absorbBar:SetPoint('LEFT', hp.otherBar:GetStatusBarTexture(), 'RIGHT')
  12.         end
  13.     end
  14. end

Lua Code:
  1. ...
  2.  
  3. self.HealPrediction.PostUpdate = HealPostUpdate
  Reply With Quote