Quantcast
Download
(3 Kb)
Download
Updated: 03/11/14 03:39 AM
Compatibility:
Beta (0.18)
Updated:03/11/14 03:39 AM
Created:03/11/14 12:45 AM
Monthly downloads:15
Total downloads:1,444
Favorites:3
MD5:
AceTimer
Version: 3.0
by: Errc [More]
Quick port over of AceTimer.

Not sure how upgrading versions would work in-game, but shouldn't be an issue with only 1 version available.

Requires LibStub.

Official API doc: http://www.wowace.com/addons/ace3/pages/api/ace-timer-3-0/

Relevant code
Code:
MyAddon = {}
LibStub("AceTimer-3.0"):Embed(MyAddon)

local id = MyAddon:ScheduleTimer(function() d("Non-Repeating") end, 10)  -- Ran once after 10 seconds
local id2 = MyAddon:ScheduleRepeatingTimer(function() d("Repeating") end, 5)  -- Ran every 5 seconds

MyAddon:CancelTimer(id2)
Quick fix to make AceTimer:TimeLeft work.
Archived Files (1)
File Name
Version
Size
Uploader
Date
3.0
3kB
03/11/14 12:45 AM


Post A Reply Comment Options
Unread 03/19/14, 09:45 PM  
Errc
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 3
Uploads: 1
Re: CancelTimer

Originally Posted by Lyeos
Hi!

I can't get "CancelTimer" to work.

Here is an exemple of how I use it:
Lua Code:
  1. WLPL_ACE        = {}
  2.  
  3. local function WLPL_MW_FadeOut()
  4.     local bg      = _G["WLPL_MW_Background"]
  5.     local title   = _G["WLPL_MW_Title"]
  6.     local divider = _G["WLPL_MW_TopDivider"]
  7.  
  8.     WLPL_FADEOUT = WLPL_ACE:ScheduleTimer(function()
  9.                                         bg:SetAlpha(0.15)
  10.                                         title:SetAlpha(0.15)
  11.                                         divider:SetAlpha(0.15)
  12.                                         end, 5)
  13. end
  14.  
  15. function WLPL_CancelFadeOut()
  16.     WLPL_ACE:CancelTimer(WLPL_ACE_FADEOUT)
  17. end

I have error but the Timer keeps going on.
Not sure if you can cancel a non-repeating timer.
Report comment to moderator  
Reply With Quote
Unread 03/19/14, 02:21 PM  
Lyeos
 
Lyeos's Avatar
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 110
Uploads: 3
CancelTimer

Hi!

I can't get "CancelTimer" to work.

Here is an exemple of how I use it:
Lua Code:
  1. WLPL_ACE        = {}
  2.  
  3. local function WLPL_MW_FadeOut()
  4.     local bg      = _G["WLPL_MW_Background"]
  5.     local title   = _G["WLPL_MW_Title"]
  6.     local divider = _G["WLPL_MW_TopDivider"]
  7.  
  8.     WLPL_FADEOUT = WLPL_ACE:ScheduleTimer(function()
  9.                                         bg:SetAlpha(0.15)
  10.                                         title:SetAlpha(0.15)
  11.                                         divider:SetAlpha(0.15)
  12.                                         end, 5)
  13. end
  14.  
  15. function WLPL_CancelFadeOut()
  16.     WLPL_ACE:CancelTimer(WLPL_ACE_FADEOUT)
  17. end

I have error but the Timer keeps going on.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: