From 115bf08364683502777d3c54905dc0d5a4a5d916 Mon Sep 17 00:00:00 2001 From: Joao Pasqualini Costa Date: Mon, 4 Mar 2013 23:45:19 -0300 Subject: [PATCH] Fix spell cooldown timer --- modules/game_cooldown/cooldown.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/game_cooldown/cooldown.lua b/modules/game_cooldown/cooldown.lua index 7c42600f..460f9ae5 100644 --- a/modules/game_cooldown/cooldown.lua +++ b/modules/game_cooldown/cooldown.lua @@ -128,12 +128,12 @@ function initCooldown(progressRect, updateCallback, finishCallback) updateCallback() end -function updateCooldown(progressRect, interval) - progressRect:setPercent(progressRect:getPercent() + 5) +function updateCooldown(progressRect, duration) + progressRect:setPercent(progressRect:getPercent() + 10000/duration) if progressRect:getPercent() < 100 then removeEvent(progressRect.event) - progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, interval) + progressRect.event = scheduleEvent(function() progressRect.callback[ProgressCallback.update]() end, 100) else progressRect.callback[ProgressCallback.finish]() end @@ -158,7 +158,7 @@ function onSpellCooldown(iconId, duration) progressRect:setTooltip(spellName) local updateFunc = function() - updateCooldown(progressRect, duration/19) + updateCooldown(progressRect, duration) end local finishFunc = function() removeCooldown(progressRect) @@ -180,7 +180,7 @@ function onSpellGroupCooldown(groupId, duration) if progressRect then removeEvent(progressRect.event) local updateFunc = function() - updateCooldown(progressRect, duration/19) + updateCooldown(progressRect, duration) end local finishFunc = function() turnOffCooldown(progressRect)