View Single Post
08-06-18, 05:10 PM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
You can get the pre-hooked method and call around it:
Code:
local SetPoint = getmetatable(BuffFrame).__index.SetPoint
hooksecurefunc(BuffFrame, 'SetPoint', function() BuffFrame:ClearAllPoints(); SetPoint(BuffFrame, 'TOPRIGHT', BattlefieldMapFrame, 'TOPLEFT', -10, 0) end)
Or in this case you can remove the hook and then apply your own hook:
Code:
BuffFrame.SetPoint = nil
local SetPoint = BuffFrame.SetPoint
hooksecurefunc(BuffFrame, 'SetPoint', function() BuffFrame:ClearAllPoints(); SetPoint(BuffFrame, 'TOPRIGHT', BattlefieldMapFrame, 'TOPLEFT', -10, 0) end)
You need to run those after ImprovedBlizzardUI has loaded and the PLAYER_LOGIN event has fired. You will also need to call BuffFrame:SetPoint() to get it to reposition.

Or you can completely replace ImprovedBlizzardUI's hook with your own:
Code:
BuffFrame.SetPoint = nil
local SetPoint = BuffFrame.SetPoint
hooksecurefunc(BuffFrame, 'SetPoint', function() BuffFrame:ClearAllPoints(); SetPoint(BuffFrame, 'TOPRIGHT', BattlefieldMapFrame, 'TOPLEFT', -10, 0) end)

local EnumerateFrames = EnumerateFrames
local frame = EnumerateFrames()
while frame do
    if frame.buffPoint == SetPoint then
        frame.buffPoint = BuffFrame.SetPoint
        break
    end
    frame = EnumerateFrames(frame)
end
You will still need to run that after ImprovedBlizzardUI has loaded but then it's code will handle the rest.
  Reply With Quote