View Single Post
08-20-11, 03:52 AM   #2
Rainrider
A Firelord
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 454
You define within your layout (if you want them to be custom):

self.Castbar.CustomTimeText
self.Castbar.CustomDelayText

and

self.Castbar.Time which is a font string

Here my custom time thingy:
lua Code:
  1. local CustomCastTimeText = function(self, duration)
  2.     self.Time:SetText(("%.1f / %.2f"):format(self.channeling and duration or self.max - duration, self.max))
  3. end
  4. ns.CustomCastTimeText = CustomCastTimeText
  5.  
  6. local CustomCastDelayText = function(self, duration)
  7.     self.Time:SetText(("%.1f |cffaf5050%s %.1f|r"):format(self.channeling and duration or self.max - duration, self.channeling and "- " or "+", self.delay))
  8. end
  9. ns.CustomCastDelayText = CustomCastDelayText

In order to show/hide them I use a script like that:
lua Code:
  1. self.Castbar:HookScript("OnShow", function() self.Castbar.Text:Show(); self.Castbar.Time:Show() end)
  2. self.Castbar:HookScript("OnHide", function() self.Castbar.Text:Hide(); self.Castbar.Time:Hide() end)

(self.Castbar.Text is the font string for the spell name on the castbar)

Hopefully this helps.
  Reply With Quote