WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Moving "DebuffButton1" separately from BuffFrame (https://www.wowinterface.com/forums/showthread.php?t=55667)

Dasteman 08-22-17 04:57 PM

Moving "DebuffButton1" separately from BuffFrame
 
Hi,

Got this script and I have some issue with it. I have the second script to move Buffs only and this one to move Debuffs only. The script itself works but it is giving me a lot of errors in PVP fights.
Do you know guys how to fix it?
Lua Code:
  1. hooksecurefunc("AuraButton_Update", function(buttonName, index, filter)
  2.  local buffName = buttonName .. index
  3.  if "DebuffButton1" ~= buffName then return end
  4.  local buff = _G[buffName]
  5.  if nil == buff or buff.moved then return end
  6.  buff:ClearAllPoints()
  7.  buff:SetPoint("TOP", PlayerFrame, "BOTTOM", 98, -10)
  8.  buff.SetPoint = function() end
  9.  buff.moved = true
  10.  end)


Lua Code:
  1. 5x [ADDON_ACTION_BLOCKED] AddOn 'Scripts' tried to call the protected function 'ArenaEnemyFrames:ClearAllPoints()'.
  2. !BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
  3. [C]: in function `ClearAllPoints'
  4. FrameXML\UIParent.lua:2854: in function `UIParentManageFramePositions'
  5. FrameXML\UIParent.lua:2142: in function <FrameXML\UIParent.lua:2129>
  6. [C]: in function `SetAttribute'
  7. FrameXML\UIParent.lua:2892: in function `UIParent_ManageFramePositions'
  8. FrameXML\BuffFrame.lua:331: in function `BuffFrame_UpdateAllBuffAnchors'
  9. FrameXML\BuffFrame.lua:104: in function `BuffFrame_Update'
  10. FrameXML\BuffFrame.lua:49: in function <FrameXML\BuffFrame.lua:45>
  11.  
  12. Locals:

Resike 08-23-17 11:03 AM

You cant do that stuff since it'll taint the whole UI.

Try this:
Lua Code:
  1. if DebuffButton_UpdateAnchors then
  2.     hooksecurefunc("DebuffButton_UpdateAnchors", function()
  3.         local d = _G.DebuffButton1
  4.         if d then
  5.             d:SetMovable(true)
  6.             d:SetUserPlaced(true)
  7.             d:ClearAllPoints()
  8.             d:SetPoint("TOP", PlayerFrame, "BOTTOM", 98, -10)
  9.             d:SetMovable(false)
  10.         end
  11.     end)
  12. end

Dasteman 08-23-17 02:56 PM

Thanks a lot! Works great.


All times are GMT -6. The time now is 10:51 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI