Quantcast Cooldown animation not working - WoWInterface
 
Thread Tools Display Modes
08-02-14, 06:59 PM   #1
galvin
A Cobalt Mageweaver
Join Date: Nov 2006
Posts: 214
Cooldown animation not working

I know blizzard added new functions for beta. My current addon cooldowns don't work. I made some sample code to test, and I just cant figure out why the cooldown is not playing. I tried messing around with DrawEdge and DrawSwipe. I even tried using blizzards function CooldownFrame_SetTimer function as well. nothing works.

Code:
local F = CreateFrame('Frame', nil, UIParent)
F:SetPoint('RIGHT')
F:SetSize(100, 100)
local CooldownFrame = CreateFrame('Cooldown', nil, F)
local Texture = F:CreateTexture()
Texture:SetTexture([[Interface\PlayerFrame\UI-PlayerFrame-Deathknight-Blood]])
Texture:SetAllPoints(F)

CooldownFrame:Show()
CooldownFrame:SetPoint('CENTER', Texture, 'CENTER', 0, 0)
CooldownFrame:SetSize(100, 100)

CooldownFrame:SetDrawEdge(false)
CooldownFrame:SetDrawSwipe(true)
CooldownFrame:SetCooldown(GetTime(), 10)
 
08-03-14, 02:56 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
DrawEdge? You mean radial cooldown display is possible?
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
08-03-14, 09:27 AM   #3
Sio
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 3
Noticed this too when patching up some addons to get them to work. Basic fix for me was to just inherit from Blizzard's cooldown frame template when creating your cooldown frames.

E.g.
Code:
bar.cooldown = CreateFrame("Cooldown", bname .. "Cooldown", bar.frame, "CooldownFrameTemplate")

Once I did that they started working and I was able to mess around with enabling and disabling the radial edge texture. You can also change the swipe texture if you really want to shake things up:
Code:
Cooldown:SetSwipeTexture("Interface\\Garrison\\Garr_TimerFill-Upgrade")

Haven't really looked if there was a way to change the edge texture or not though.
 
08-03-14, 11:54 AM   #4
galvin
A Cobalt Mageweaver
Join Date: Nov 2006
Posts: 214
That's weird you have to use the template. Wonder why they made it work that way.
Thanks

Well beta is down, I'll give it a try later.

Yeah cooldown animation has a lot of options now looking at the new functions.
The texture cooldown functions take an r, g, b, a as section parameter.

Last edited by galvin : 08-03-14 at 11:56 AM.
 
08-03-14, 12:01 PM   #5
Sio
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 3
Originally Posted by galvin View Post
That's weird you have to use the template. Wonder why they made it work that way.
Thanks
Yeah I don't know if it's intended or not or just some consequence of how in flux certain parts of the UI systems are right now. It's just the easiest way I found to get it to work right now. And since that's all I was really looking for at the time I didn't dig a whole lot deeper.
 
08-03-14, 05:04 PM   #6
galvin
A Cobalt Mageweaver
Join Date: Nov 2006
Posts: 214
Have a new problem. I can't change the size of the cooldown. It ignores SetSize()

Fixed it, ClearAllPoints(), forgot the template had that in there.

Last edited by galvin : 08-03-14 at 05:19 PM.
 
08-09-14, 12:28 PM   #7
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
OT: What is the new SwipeTexture element within the cooldown frame good for?

E: Oh, ok. This is the new cooldown texture itself. So, the cooldowns are not longer rendered into the UI by the game engine itself?
Is there any way to reference the texture object?

The point is: I would like to get rid of it ... without removing or hiding the cooldown frame itself. I've used <cooldownframe>:SetAlpha(0) before WoD. But the SwipeTexture child ignores this. :/

E1: Ok. Nevermind. Setting the texture to an empty texture via SetSwipeTexture works.

Last edited by Duugu : 08-09-14 at 12:43 PM.
 
08-09-14, 01:59 PM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,635
This is the default ActionButton UpdateCooldown function (Build 18663)
Lua Code:
  1. function ActionButton_UpdateCooldown (self)
  2.         local locStart, locDuration = GetActionLossOfControlCooldown(self.action);
  3.         local start, duration, enable, charges, maxCharges = GetActionCooldown(self.action);
  4.  
  5.         if ( (locStart + locDuration) > (start + duration) ) then
  6.                 if ( self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_LOSS_OF_CONTROL ) then
  7.                         self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge-LoC");
  8.                         self.cooldown:SetSwipeColor(0.17, 0, 0);
  9.                         self.cooldown:SetHideCountdownNumbers(true);
  10.                         self.cooldown.currentCooldownType = COOLDOWN_TYPE_LOSS_OF_CONTROL;
  11.                 end
  12.                
  13.                 CooldownFrame_SetTimer(self.cooldown, locStart, locDuration, 1, nil, nil, true);
  14.         else
  15.                 if ( self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_NORMAL ) then
  16.                         self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge");
  17.                         self.cooldown:SetSwipeColor(0, 0, 0);
  18.                         self.cooldown:SetHideCountdownNumbers(false);
  19.                         self.cooldown.currentCooldownType = COOLDOWN_TYPE_NORMAL;
  20.                 end
  21.                
  22.                 CooldownFrame_SetTimer(self.cooldown, start, duration, enable, charges, maxCharges);
  23.         end
  24. end
https://github.com/tekkub/wow-ui-sou...utton.lua#L455
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
 
 

WoWInterface » Site Forums » Archived Beta Forums » WoD Beta archived threads » Cooldown animation not working

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off