View Single Post
07-24-14, 03:12 PM   #6
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Can i hijack this thread to ask if it's possible to move the boss unit frames without causing taint - since they don't have the right-click + move option?

Lua Code:
  1. local a = {Boss1TargetFrame:GetPoint()}
  2.     Boss1TargetFrame:ClearAllPoints()
  3.     Boss1TargetFrame:SetPoint(a[1],a[2],a[3],a[4]-22, a[5]-70)
  4.     Boss1TargetFrame.SetPoint = function() end

Lua Code:
  1. hooksecurefunc("TargetFrame_OnEvent", function(self, event)
  2.         if (event=="INSTANCE_ENCOUNTER_ENGAGE_UNIT") then
  3.             for i = 1, MAX_BOSS_FRAMES do
  4.                 if ( _G["Boss"..i.."TargetFrame"]:IsShown()) then
  5.                     numBossFrames = i;
  6.                 end
  7.             end
  8.             if (numBossFrames > 0) then
  9.                 local frame = CreateFrame("Frame")
  10.                 frame:SetPoint("TOP", MinimapCluster, "BOTTOM", 0, -40)
  11.                 Boss1TargetFrame:SetParent(frame)
  12.                 Boss1TargetFrame:ClearAllPoints()
  13.                 Boss1TargetFrame:SetPoint("TOP", frame, "TOP", 0, 0)
  14.             end
  15.         end
  16.     end)

Lua Code:
  1. local bossParent = CreateFrame("Frame")
  2.     bossParent:SetPoint("TOP", MinimapCluster, "BOTTOM", 10, -80)
  3.  
  4.     local HandleFrame = function(baseName)
  5.         local frame
  6.         if(type(baseName) == 'string') then
  7.             frame = _G[baseName]
  8.         else
  9.             frame = baseName
  10.         end
  11.  
  12.         if (frame) then
  13.             -- move frame without causing taint (?)
  14.             frame:ClearAllPoints()
  15.             frame:SetParent(bossParent)
  16.             frame:SetPoint("TOP", bossParent, "TOP", 0, 0)
  17.         end
  18.     end
  19.    
  20.     function MoveTheFuckinBoss(unit)
  21.         if(not unit) then return end
  22.  
  23.         if(unit:match'(boss)%d?$' == 'boss') then
  24.             local id = unit:match'boss(%d)'
  25.             if(id) then
  26.                 HandleFrame('Boss'..id..'TargetFrame')
  27.             else
  28.                 for i=1, 4 do
  29.                     HandleFrame(('Boss%dTargetFrame'):format(i))
  30.                 end
  31.             end
  32.         end
  33.     end
  34.    
  35.     hooksecurefunc("UIParent_ManageFramePositions", MoveTheFuckinBoss)

Trying things like this has either failed to produce results, caused an ADDON_ACTION_BLOCKED error, or both.
  Reply With Quote