Quantcast
CastingBarFrame.timer doesnt work anymore - WoWInterface
Thread Tools Display Modes
08-10-16, 03:42 PM   #1
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
CastingBarFrame.timer doesnt work anymore

After patch 7.0 this little timer under my castbar stopped working.
Could some kind person help me fix this script?
Lua Code:
  1. --Cast bar timer
  2. CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil);
  3. CastingBarFrame.timer:SetFont(STANDARD_TEXT_FONT,12,"OUTLINE");
  4. CastingBarFrame.timer:SetPoint("TOP", CastingBarFrame, "BOTTOM", 0, -3);
  5. CastingBarFrame.update = .1;
  6.  
  7. hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
  8.         if not self.timer then return end
  9.         if self.update and self.update < elapsed then
  10.                 if self.casting then
  11.                         self.timer:SetText(format("%2.1f/%1.1f", max(self.maxValue - self.value, 0), self.maxValue))
  12.                 elseif self.channeling then
  13.                         self.timer:SetText(format("%.1f", max(self.value, 0)))
  14.                 else
  15.                         self.timer:SetText("")
  16.                 end
  17.                 self.update = .1
  18.         else
  19.                 self.update = self.update - elapsed
  20.         end
  21. end)


Thank you in advance.
  Reply With Quote
08-10-16, 04:04 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,057
The casting bars no longer actually call CastingBarFrame_OnUpdate(). They have it set directly as their OnUpdate handler, which means you'll need to hook the script.

Change line 7 to the following and it should be fine.
Code:
CastingBarFrame:HookScript("OnUpdate",function(self,elapsed)
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
08-10-16, 04:38 PM   #3
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
Works!

Thank you so much.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » CastingBarFrame.timer doesnt work anymore

Thread Tools
Display Modes

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