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:
--SetCooldownSwipeAlpha
local function SetCooldownSwipeAlpha(self,alpha)
local r,g,b = self.cooldown:GetSwipeColor()
self.cooldown:SetSwipeColor(r,g,b,self.cooldown.alpha*alpha)
end
--ApplyButtonCooldownAlphaFix
local function ApplyButtonCooldownAlphaFix(button)
if not button then return end
if not button.cooldown then return end
local r,g,b,a = button.cooldown:GetSwipeColor()
button.cooldown.alpha = a
hooksecurefunc(button, "SetAlpha", SetCooldownSwipeAlpha)
end
do
--style the actionbar buttons
for i = 1, NUM_ACTIONBAR_BUTTONS do
ApplyButtonCooldownAlphaFix(_G["ActionButton"..i])
ApplyButtonCooldownAlphaFix(_G["MultiBarBottomLeftButton"..i])
ApplyButtonCooldownAlphaFix(_G["MultiBarBottomRightButton"..i])
ApplyButtonCooldownAlphaFix(_G["MultiBarRightButton"..i])
ApplyButtonCooldownAlphaFix(_G["MultiBarLeftButton"..i])
end
--override buttons
for i = 1, 6 do
ApplyButtonCooldownAlphaFix(_G["OverrideActionBarButton"..i])
end
--petbar buttons
for i=1, NUM_PET_ACTION_SLOTS do
ApplyButtonCooldownAlphaFix(_G["PetActionButton"..i])
end
--stancebar buttons
for i=1, NUM_STANCE_SLOTS do
ApplyButtonCooldownAlphaFix(_G["StanceButton"..i])
end
--possess buttons
for i=1, NUM_POSSESS_SLOTS do
ApplyButtonCooldownAlphaFix(_G["PossessButton"..i])
end
end