- fixed rotation of inverted bars to draw the bar correctly

- better method of turning the player and pet casting frames back when enabling the "show default cast bar" option in the player cast bar
This commit is contained in:
Parnic
2010-10-11 05:50:10 +00:00
parent 4e1c8ecf12
commit 3a68ef1a61
2 changed files with 16 additions and 16 deletions

View File

@ -805,7 +805,7 @@ function IceBarElement.prototype:CreateFrame()
self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end) self.frame:SetScript("OnUpdate", function() self:MyOnUpdate() end)
end end
if self.moduleSettings.rotateBar and self.frame.anim == nil then if self.moduleSettings.rotateBar then
self:RotateHorizontal() self:RotateHorizontal()
end end
end end
@ -1229,6 +1229,10 @@ function IceBarElement.prototype:ResetRotation()
end end
function IceBarElement.prototype:RotateFrame(frame) function IceBarElement.prototype:RotateFrame(frame)
if not frame then
return
end
if frame.anim == nil then if frame.anim == nil then
local grp = frame:CreateAnimationGroup() local grp = frame:CreateAnimationGroup()
local rot = grp:CreateAnimation("Rotation") local rot = grp:CreateAnimation("Rotation")
@ -1237,10 +1241,18 @@ function IceBarElement.prototype:RotateFrame(frame)
rot:SetOrder(1) rot:SetOrder(1)
rot:SetDuration(0.001) rot:SetDuration(0.001)
rot:SetDegrees(-90) rot:SetDegrees(-90)
rot:SetOrigin("BOTTOMLEFT", 0, 0)
grp.rot = rot grp.rot = rot
frame.anim = grp frame.anim = grp
end end
local anchorPoint
if self.moduleSettings.inverse then
anchorPoint = "TOPLEFT"
else
anchorPoint = "BOTTOMLEFT"
end
frame.anim.rot:SetOrigin(anchorPoint, 0, 0)
frame.anim.rot:SetScript("OnUpdate", function(anim) if anim:GetProgress() >= 1 then anim:Pause() anim:SetScript("OnUpdate", nil) end end) frame.anim.rot:SetScript("OnUpdate", function(anim) if anim:GetProgress() >= 1 then anim:Pause() anim:SetScript("OnUpdate", nil) end end)
frame.anim:Play() frame.anim:Play()
end end

View File

@ -330,20 +330,8 @@ end
function CastBar.prototype:ToggleBlizzCast(on) function CastBar.prototype:ToggleBlizzCast(on)
if on then if on then
-- restore blizz cast bar -- restore blizz cast bar
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SENT"); CastingBarFrame:GetScript("OnLoad")(CastingBarFrame)
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_START"); PetCastingBarFrame:GetScript("OnLoad")(PetCastingBarFrame)
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_STOP");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_FAILED");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_DELAYED");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE");
CastingBarFrame:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP");
PetCastingBarFrame:RegisterEvent("UNIT_PET");
else else
-- remove blizz cast bar -- remove blizz cast bar
CastingBarFrame:UnregisterAllEvents() CastingBarFrame:UnregisterAllEvents()