Quantcast
WoWInterface - View Single Post - [WIP] Adjusting bunitframes to my taste and needs, help required!
View Single Post
02-15-13, 06:06 AM   #5
Wildbreath
A Cyclonian
 
Wildbreath's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 46
look for updateAuraButton function
lua Code:
  1. icon.overlay:SetTexture(.2,.2,.2)
  2. if isDebuff then
  3.     local color = DebuffTypeColor[dtype] or { r=.1, g=.1, b=.1 }
  4.     icon.overlay:SetTexture(color.r, color.g, color.b)
  5. end
  6. icon.overlay:Show()
and a default UI DebuffTypeColor array
lua Code:
  1. DebuffTypeColor = { };
  2. DebuffTypeColor["none"] = { r = 0.80, g = 0, b = 0 };
  3. DebuffTypeColor["Magic"]    = { r = 0.20, g = 0.60, b = 1.00 };
  4. DebuffTypeColor["Curse"]    = { r = 0.60, g = 0.00, b = 1.00 };
  5. DebuffTypeColor["Disease"]  = { r = 0.60, g = 0.40, b = 0 };
  6. DebuffTypeColor["Poison"]   = { r = 0.00, g = 0.60, b = 0 };
  7. DebuffTypeColor[""] = DebuffTypeColor["none"];
visibility: add that code to layout function, as i know we can change alpha in combat, so use it
lua Code:
  1. self:SetScript('OnUpdate', function(self, elapsed)
  2.     if not self:IsShown() then return end
  3.     self.st = elapsed + (self.st or 0)
  4.     if self.st > .2 then
  5.         local h, mh = UnitHealth(self.unit) or 1, UnitMaxHealth(self.unit) or 100
  6.         local perc = h/(mh/100)
  7.         if perc < 100 or InCombatLockdown() or UnitAffectingCombat('player') then
  8.             self:SetAlpha(1)
  9.         else
  10.             self:SetAlpha(0)
  11.         end
  12.         self.st = 0
  13.     end
  14. end)

Last edited by Wildbreath : 02-15-13 at 06:14 AM.
  Reply With Quote