CastingBar = CreateFrame("StatusBar")
CastingBar:SetStatusBarTexture(1,0,1)
CastingBar:GetStatusBarTexture():SetHorizTile(false)
CastingBar:SetReverseFill(true)
CastingBar:SetWidth(100)
CastingBar:SetHeight(15)
CastingBar:SetPoint("CENTER",UIParent,0,0)
local function OnUpdate(self)
local spell, _, _, _, startTime, endTime = UnitCastingInfo("player")
if spell then
--ChatFrame1:AddMessage(spell .. ' will be finished casting in ' .. endTime/1000 - GetTime() .. ' seconds.')
CastingBar:SetMinMaxValues(0, startTime)
CastingBar:SetValue(endTime/1000 - GetTime())
else
CastingBar:SetValue(0)
end
end
CastingBar:SetScript("OnUpdate", OnUpdate)
CastingBar:SetMinMaxValues(0, startTime) seems to work with a number like:
CastingBar:SetMinMaxValues(0, 10)but don't know how to get the whole castingtime to set the MaxValue...










