Thread: HealPrediction
View Single Post
10-08-13, 03:26 PM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
This is what I'm doing:
Lua Code:
  1. --heal prediction
  2.   func.healPrediction = function(self)
  3.     if not self.cfg.healprediction or (self.cfg.healprediction and not self.cfg.healprediction.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.     -- my heals
  9.     local mhpb = CreateFrame("StatusBar", nil, self.Health)
  10.     mhpb:SetFrameLevel(self.Health:GetFrameLevel())
  11.     mhpb:SetPoint("TOPLEFT", self.Health:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
  12.     mhpb:SetPoint("BOTTOMLEFT", self.Health:GetStatusBarTexture(), "BOTTOMRIGHT", 0, 0)
  13.     mhpb:SetWidth(w)
  14.     mhpb:SetStatusBarTexture(self.cfg.healprediction.texture)
  15.     mhpb:SetStatusBarColor(self.cfg.healprediction.color.myself.r,self.cfg.healprediction.color.myself.g,self.cfg.healprediction.color.myself.b,self.cfg.healprediction.color.myself.a)
  16.     -- other heals
  17.     local ohpb = CreateFrame("StatusBar", nil, self.Health)
  18.     ohpb:SetFrameLevel(self.Health:GetFrameLevel())
  19.     ohpb:SetPoint("TOPLEFT", mhpb:GetStatusBarTexture(), "TOPRIGHT", 0, 0)
  20.     ohpb:SetPoint("BOTTOMLEFT", mhpb:GetStatusBarTexture(), "BOTTOMRIGHT", 0, 0)
  21.     ohpb:SetWidth(w)
  22.     ohpb:SetStatusBarTexture(self.cfg.healprediction.texture)
  23.     ohpb:SetStatusBarColor(self.cfg.healprediction.color.other.r,self.cfg.healprediction.color.other.g,self.cfg.healprediction.color.other.b,self.cfg.healprediction.color.other.a)
  24.     -- Register it with oUF
  25.     self.HealPrediction = {
  26.       myBar = mhpb,
  27.       otherBar = ohpb,
  28.       maxOverflow = self.cfg.healprediction.maxoverflow,
  29.     }
  30.   end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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