Thread Tools Display Modes
08-22-17, 04:57 PM   #1
Dasteman
A Murloc Raider
 
Dasteman's Avatar
Join Date: Feb 2017
Posts: 8
Question 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:
  Reply With Quote
08-23-17, 11:03 AM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
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
  Reply With Quote
08-23-17, 02:56 PM   #3
Dasteman
A Murloc Raider
 
Dasteman's Avatar
Join Date: Feb 2017
Posts: 8
Thanks a lot! Works great.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Moving "DebuffButton1" separately from BuffFrame

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off