Permalink
Browse files

Initial commit

git-svn-id: svn://svn.wowinterface.com/oUF_BarFader-229/trunk@3 cbe42a47-3b53-4817-a5a9-47e79666164c
  • Loading branch information...
1 parent 767430f commit 29a1c08faa5837737327cfa177b2891fda6f34ce p3lim-52096 committed Aug 29, 2008
Showing with 40 additions and 0 deletions.
  1. +32 −0 oUF_BarFader/oUF_BarFader.lua
  2. +8 −0 oUF_BarFader/oUF_BarFader.toc
@@ -0,0 +1,32 @@
+local function UpdateElement(self)
+ local notFull = UnitHealth('player') ~= UnitHealthMax('player') or
+ (UnitPowerType("player") == 1 and UnitMana('player') > 0) or
+ (UnitPowerType("player") ~= 1 and UnitMana('player') ~= UnitManaMax('player'))
+
+ if(notFull) then
+ self:SetAlpha(1)
+ elseif(UnitAffectingCombat('player')) then
+ self:SetAlpha(1)
+ elseif(UnitExists('target')) then
+ self:SetAlpha(1)
+ elseif(self.Castbar.casting) then
+ self:SetAlpha(1)
+ else
+ self:SetAlpha(self.BarFade.alpha or 0.25)
+ end
+end
+
+oUF:RegisterInitCallback(function(self)
+ local unit = self.unit
+ if(self.BarFade) then
+ local val = 0
+ local event = CreateFrame('Frame')
+ event:SetScript('OnUpdate', function(_, al)
+ val = val + al
+ if(val > 0.25) then
+ UpdateElement(self)
+ val = 0
+ end
+ end)
+ end
+end)
@@ -0,0 +1,8 @@
+## Interface: 20400
+## Author: p3lim
+## Version: Revision wowi:revision
+## Title: oUF BarFader
+## Notes: Condition fading support for oUF layouts
+## RequiredDeps: oUF
+
+oUF_BarFader.lua

0 comments on commit 29a1c08

Please sign in to comment.