View Single Post
10-16-14, 01:52 AM   #13
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I thought about it. This may fix the issue. According to the ActionButtonTemplate.xml the cooldown is available as button.cooldown.

There is a problem though. There may be any sort of inate alpha. We need to save that.

Lua Code:
  1. --SetCooldownSwipeAlpha
  2. local function SetCooldownSwipeAlpha(self,alpha)
  3.   local r,g,b = self.cooldown:GetSwipeColor()
  4.   self.cooldown:SetSwipeColor(r,g,b,self.cooldown.alpha*alpha)
  5. end
  6.  
  7. --ApplyButtonCooldownAlphaFix
  8. local function ApplyButtonCooldownAlphaFix(button)
  9.   if not button then return end
  10.   if not button.cooldown then return end
  11.   local r,g,b,a = button.cooldown:GetSwipeColor()
  12.   button.cooldown.alpha = a
  13.   hooksecurefunc(button, "SetAlpha", SetCooldownSwipeAlpha)
  14. end
  15.  
  16. do
  17.   --style the actionbar buttons
  18.   for i = 1, NUM_ACTIONBAR_BUTTONS do
  19.     ApplyButtonCooldownAlphaFix(_G["ActionButton"..i])
  20.     ApplyButtonCooldownAlphaFix(_G["MultiBarBottomLeftButton"..i])
  21.     ApplyButtonCooldownAlphaFix(_G["MultiBarBottomRightButton"..i])
  22.     ApplyButtonCooldownAlphaFix(_G["MultiBarRightButton"..i])
  23.     ApplyButtonCooldownAlphaFix(_G["MultiBarLeftButton"..i])
  24.   end
  25.   --override buttons
  26.   for i = 1, 6 do
  27.     ApplyButtonCooldownAlphaFix(_G["OverrideActionBarButton"..i])
  28.   end
  29.   --petbar buttons
  30.   for i=1, NUM_PET_ACTION_SLOTS do
  31.     ApplyButtonCooldownAlphaFix(_G["PetActionButton"..i])
  32.   end
  33.   --stancebar buttons
  34.   for i=1, NUM_STANCE_SLOTS do
  35.     ApplyButtonCooldownAlphaFix(_G["StanceButton"..i])
  36.   end
  37.   --possess buttons
  38.   for i=1, NUM_POSSESS_SLOTS do
  39.     ApplyButtonCooldownAlphaFix(_G["PossessButton"..i])
  40.   end
  41. 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)

Last edited by zork : 10-16-14 at 11:01 AM.
  Reply With Quote