Wouldn't you just be able to do
lua Code:
hooksecurefunc(Boss1TargetFrame, "SetPoint", function()
Boss1TargetFrame:SetPoint("TOPRIGHT",UIParent,"TOPRIGHT",-350,-470)
end)
Though you might need a workaround like here, if you don't want it to just keep recursively calling itself (might make the game crash?):
https://us.battle.net/forums/en/wow/...9273821#post-5
One way to do it is to do a hooksecurefunc(ReputationWatchBar,"SetPoint",func). This will securely call func whenever anything does a ReputationWatchBar:SetPoint(). But since we want to do a SetPoint in this hook itself, we need to be careful it doesn't trigger itself indefinitely. Like this:
lua Code:
hooksecurefunc(ReputationWatchBar,"SetPoint",function(self,_,_,_,_,_,flag) if flag~="mbars" then self:ClearAllPoints() if level==100 then self:SetPoint("BOTTOMLEFT",ActionButton1,"TOPLEFT",0,0,"mbars") else self:SetPoint("BOTTOMLEFT",MultiBarBottomLeftButton1,"TOPLEFT",0,0,"mbars") end end end)
Now whenever ReputationWatchBar:SetPoint() happens in the default UI (or another addon), this addon will immediately SetPoint again, passing the "mbars" flag (can be anything, something unique that only this addon knows about) so it knows not to do another SetPoint in response to this SetPoint.
|
This is for a different frame but I imagine it'd be the same concept.