View Single Post
05-24-10, 03:28 PM   #27
pingbo
A Defias Bandit
Join Date: May 2006
Posts: 3
McCC

Here's a CooldownCount (this code is basically taken from evl's BlizzardTweaks and then stuffed through a meat grinder).

1:
Code:
local h,c,t,b,x,U=hooksecurefunc,"CENTER"U=function(f,e)if f.x and f.a then t=ceil(f.s+f.d-GetTime())if f.e>0 and t>0 then f.x:T(t)else f.x:T""f.a=false end end end h("ActionButton_OnUpdate",U)h("CooldownFrame_SetTimer",function(f,s,d,e)b=Ij(f:GetParent(
2:
Code:
))if s>0 and d>3 and e>0 then if not b.x then t=CF("Frame",b:N().."C",f)t:SzPt(32,32,c,b,c)x=Ij(t:CF(nil,"ARTWORK"))x:SetFont(NAMEPLATE_FONT,20)x:SetTextColor(1,.9,.2)x:SAP(t)x:SetJustifyH(c)b.x=x else b.x:T""end b.a,b.s,b.d,b.e=true,s,d,e U(f,1)end end)
Original:
Code:
local h,c,t,b,x,U=hooksecurefunc,"CENTER"
U=function(f,e)
	if f.x and f.a then
		t=ceil(f.s+f.d-GetTime())
		if f.e>0 and t>0 then
			f.x:T(t)
		else
			f.x:T""
			f.a=false
		end
	end
end
h("ActionButton_OnUpdate",U)
h("CooldownFrame_SetTimer",function(f,s,d,e)
	b=Ij(f:GetParent())
	if s>0 and d>3 and e>0 then
		if not b.x then
			t=CF("Frame",b:N().."C",f)
			t:SzPt(32,32,c,b,c)
			x=Ij(t:CF(nil,"ARTWORK"))
			x:SetFont(NAMEPLATE_FONT,20)
			x:SetTextColor(1,.9,.2)
			x:SAP(t)
			x:SetJustifyH(c)
			b.x=x
		else
			b.x:T""
		end
		b.a,b.s,b.d,b.e=true,s,d,e
		U(f,1)
	end
end)

Edit: With McRun 1.3 and a lot of finessing, I was able to get this down to 2 macros. I removed the stipulation that it only shows for abilities with less than one minute cooldowns, mostly to save space (so an ability with a 2-minute cooldown might show up as "1..." for a while until it gets below 100 seconds).

Last edited by pingbo : 05-26-10 at 01:14 PM. Reason: new version
  Reply With Quote