View Single Post
07-26-16, 09:35 AM   #1
Rufio
A Murloc Raider
 
Rufio's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 9
Could you fix my castbar?

Hello, since Legion Pre-Patch my castbars won't work...
I'm not into lua, so maybe you can help me out!

Thanks in advance

Code:
--[[ Player castbar ]]
    CastingBarFrame:SetSize(180,10)
    CastingBarFrame:SetScale("1.4")
    CastingBarFrame:ClearAllPoints()
    CastingBarFrame:SetPoint("TOP", WorldFrame, "BOTTOM", 0, 130) --0, 100
    CastingBarFrame.SetPoint = function() end 
     
    CastingBarFrameBorder:SetSize(240,40)
    CastingBarFrameBorder:SetPoint("TOP", CastingBarFrame, 0, 15)
    CastingBarFrameBorder:SetTexture("Interface\\CastingBar\\UI-CastingBar-Border-Small")
     
    CastingBarFrameFlash:SetSize(240,40)
    CastingBarFrameFlash:SetPoint("TOP", CastingBarFrame, 0, 15)
    CastingBarFrameFlash:SetTexture("Interface\\CastingBar\\UI-CastingBar-Flash-Small")
     
    CastingBarFrameText:SetPoint("TOP", CastingBarFrame, 0, 4)
     
    CastingBarFrameIcon:Show()
    CastingBarFrameIcon:SetHeight(22)
    CastingBarFrameIcon:SetWidth(22)
     
    --[[ Castbar timer from thek ]]
    CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil)
    CastingBarFrame.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
    CastingBarFrame.timer:SetPoint("RIGHT", CastingBarFrame, "RIGHT", 24, 0)
    CastingBarFrame.update = 0.1
     
    TargetFrameSpellBar.timer = TargetFrameSpellBar:CreateFontString(nil)
    TargetFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
    TargetFrameSpellBar.timer:SetPoint("RIGHT", TargetFrameSpellBar, "RIGHT", 24, 0)
    TargetFrameSpellBar.update = 0.1
     
    FocusFrameSpellBar.timer = FocusFrameSpellBar:CreateFontString(nil)
    FocusFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
    FocusFrameSpellBar.timer:SetPoint("RIGHT", FocusFrameSpellBar, "RIGHT", 24, 0)
    FocusFrameSpellBar.update = 0.1
     
    hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
        if not self.timer then return end
        if self.update and self.update < elapsed then
            if self.casting then
                self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
            elseif self.channeling then
                self.timer:SetText(format("%.1f", max(self.value, 0)))
            else
                self.timer:SetText("")
            end
            self.update = 0.1
        else
            self.update = self.update - elapsed
        end
    end)
  Reply With Quote