Thread Tools Display Modes
09-26-14, 06:15 AM   #1
Ohaiyo
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 2
GetActionCooldown() on action bar 1

I'v been writing a large overhaul addon for a while now mainly as a project for fun and myself but i'm putting it on wow interface as well and I am struggling with an OmniCC style text display on my action bars. I'm using GetActionCooldown and it is working fine for the bottom left action bar but on the main action bar it doesn't seem to be showing the duration properly and I can't work out why. I have checked the outputs from the function and it seems that the problem is the values that are being returned from GetActionCooldown(). If someone would mind having a look and giving me some advice I would be very grateful. (I have included the section of code here and also linked my addon so people can have a look at the whole thing).

Code:
local function formatTime(duration)
	local outputValue = ""
	if duration > 3600 then
		return math.floor(duration / 3600) .."H"
	elseif duration > 60 then
		return math.floor(duration / 60) .."M"
	else
		return math.floor(duration)
	end
end

local function OnUpdate(self, elapsed)
	waiting = waiting + elapsed
	if waiting > updateInterval then
		for i = 1, 24 do
			local totalI = 0
			if i < 13 then totalI = i
			else totalI = i + 48 end
			
			local start, duration, enable = GetActionCooldown(totalI)
			local timeLeft = ((start + duration) - GetTime())

			if duration > 1 then
				cooldownTimer[i]:SetText(formatTime(timeLeft))
			else
				cooldownTimer[i]:SetText("")
			end
		end
	end
end

local update = CreateFrame("Frame")
update:SetScript("OnUpdate", OnUpdate)
Attached Files
File Type: zip OhaiyoUI.zip (21.9 KB, 121 views)
  Reply With Quote
09-26-14, 07:10 AM   #2
Ohaiyo
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 2
Ah nvm I worked it out. I didn't realise that the action slot changes with stance on certain classes... duh
  Reply With Quote
09-26-14, 07:44 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
A numerical cooldown display is coming in WoD.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetActionCooldown() on action bar 1


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