View Single Post
12-20-13, 12:56 AM   #4
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Try:
Code:
local function FocusCastbarReposition()
  local focusRight = FocusFramePortrait:GetRight() * FocusFrame:GetEffectiveScale() / FocusFrameSpellBar:GetEffectiveScale()
  local castRight = FocusFrameSpellBar:GetRight()
  local point, relFrame, relPoint, xOffset, yOffset = FocusFrameSpellBar:GetPoint()
  FocusFrameSpellBar:ClearAllPoints()
  FocusFrameSpellBar:SetPoint(point, relFrame, relPoint, xOffset + focusRight - castRight, yOffset)
  Addon:SetScript("OnUpdate", nil)
end
 
-- Changing the X-offset of FocusFrame's castbar in the
-- next frame (when the anchor values will be updated)
hooksecurefunc(FocusFrameSpellBar, "SetPoint", function()
  Addon:SetScript("OnUpdate", FocusCastbarReposition)
end)
  Reply With Quote