Thread Tools Display Modes
09-19-10, 05:34 PM   #1
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
SetCooldown questions

Hey all.

Is it possible to specify if some time has already passed when using SetCooldown?

I have a button you see, which I use to cast one of two buffs. I want to use the cooldown model as a timer to see how long is remaining. But I can't make the cooldown model reflect if time has already passed, like if I login and the buff is at 30 seconds and the total duration of it is 60 seconds, I'd like it to start at already half-filled.

Is this even possible? I noticed actionbars can use GetActionCooldown, but that only seems to work if you're using one of the 120 action-ids.

Any thoughts?

Thanks in advance.
__________________
Oh, the simulated horror!
  Reply With Quote
09-19-10, 07:03 PM   #2
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
The simplest thing you could do is adjust the start time.
  Reply With Quote
09-20-10, 04:21 AM   #3
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
You know, I was just being an idiot and totally missed why it wasn't working.

Thanks!

EDIT: Seems I have another problem now though.. it's not updating correctly if the is running on login. Maybe I'm just being an idiot again. :P
__________________
Oh, the simulated horror!

Last edited by Ailae : 09-20-10 at 04:25 AM.
  Reply With Quote
09-20-10, 08:22 AM   #4
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
For some reason the spiral is not showing up when I reload the interface. It seems to working just fine if I'm logging in for the first time.

I'm updating the timer at PLAYER_ENTERING_WORLD to catch running timers, is this too soon?

I've noticed that when I do a fresh login UNIT_AURA fires for the player as opposed to when doing a reload. I tried forcing a UNIT_AURA at P_E_W but that didn't help much. I'm not sure which event fires after P_E_W besides PLAYER_ALIVE, which doesn't fire on a reload anyway.

Should I delay it manually with a timer? That sounds crazy though.

EDIT: So it seems the spiral is there, but hidden behind my icon.. If I manually bump the framelevel by 1 it shows up, but setting it explicitly in the code or changing the FrameStrata does nothing. Ngngngng.
__________________
Oh, the simulated horror!

Last edited by Ailae : 09-20-10 at 10:22 AM. Reason: Updated with more info, didn't want to triple-post.
  Reply With Quote
09-23-10, 12:25 PM   #5
Taroven
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 49
If you need something to happen later in the load process, LFG_LOCK_INFO_RECEIVED fires directly after coming out of the loading screen for both login and reloadui. Doesn't always fire when entering a battleground, but it's easy enough to work around that.

I use this to get glyph and equipped item information in the beta, due to GetGlyphSocketInfo and GetItemInfo often returning nil before then. Just make sure you unregister the event after it fires for the first time if you're only using it as a load check.
__________________
Former author of EventHorizon Continued and Other Releases.
  Reply With Quote
09-23-10, 12:35 PM   #6
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
Thanks for the reply, I'll take a stab it.

But at the moment it's just acting weird, it works correctly on live but not on beta.

I wrote about it here:
http://forums.worldofwarcraft.com/th...68451&sid=2000
__________________
Oh, the simulated horror!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetCooldown questions

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