View Single Post
05-16-20, 02:13 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
All nUI does is set the Alpha value to the cooldown layer.

I'm not sure how useful this will be for you but this is some code from nUI that uses cooldowns on its buttons
Lua Code:
  1. function nUI_ButtonBars:createBar( name, layout )
  2.   local bar  = CreateFrame( "Frame", name, nUI_Dashboard.Anchor, "SecureHandlerStateTemplate,SecureHandlerAttributeTemplate" );
  3.  
  4.   local id         = (rowsloop - 1) * layout.cols + colsloop;
  5.   local button     = CreateFrame( "CheckButton", "$parent_Button"..id, bar, "ActionBarButtonTemplate" );
  6.   ..
  7.   nUI:initActionButton( button );
  8.   ..
  9. end
  10.  
  11. function nUI:initActionButton( button )
  12.   local btn_name = button:GetName()
  13.   local overlay  = CreateFrame( "Frame", "$parent_ActionOverlay", button );
  14.   ...
  15.   overlay.layers.cooldown  = _G[btn_name.."Cooldown"]
  16.   ...
  17.   overlay.layers.cooldown:SetAlpha( 1 )
  18.   ...
  19. end

This is Blizzards Button code .. in the UpdateCooldown function there are some code blocks regarding set up of the swipe texture. They don't use the alpha fading on that itself though.
https://www.townlong-yak.com/framexm...tionButton.lua
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote