View Single Post
01-18-14, 12:17 PM   #8
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
I also have been playing this recently:

Lua Code:
  1. hooksecurefunc("CompactRaidFrameManager_Expand", function(self)
  2.     if MovAny:IsModified(self) then
  3.         MovAny:UnlockPoint(self)
  4.         local point, relativeTo, relativePoint, xOfs, yOfs = self:GetPoint(1)
  5.         self:ClearAllPoints()
  6.         self:SetPoint("TOPLEFT", UIParent, "TOPLEFT", xOfs + 175, yOfs)
  7.         MovAny:LockPoint(self)
  8.     end
  9. end)
  10. hooksecurefunc("CompactRaidFrameManager_Collapse", function(self)
  11.     if MovAny:IsModified(self) then
  12.         MovAny:UnlockPoint(self)
  13.         local point, relativeTo, relativePoint, xOfs, yOfs = self:GetPoint(1)
  14.         self:ClearAllPoints()
  15.         self:SetPoint("TOPLEFT", UIParent, "TOPLEFT", xOfs - 175, yOfs)
  16.         MovAny:LockPoint(self)
  17.     end
  18. end)
  19. -- Before you hide it to keep the raidframes:
  20. if fn == "CompactRaidFrameManager" then
  21.     if InCombatLockdown() or UnitAffectingCombat("player") then
  22.         return
  23.     end
  24.     f:UnregisterAllEvents()
  25.     CompactRaidFrameContainer:SetParent(UIParent)
  26. end
  27. -- Before you reshow it, reparent and repoint raidframe to it:
  28. if fn == "CompactRaidFrameManager" then
  29.     if InCombatLockdown() or UnitAffectingCombat("player") then
  30.         return
  31.     end
  32.     f:RegisterEvent("DISPLAY_SIZE_CHANGED")
  33.     f:RegisterEvent("UI_SCALE_CHANGED")
  34.     f:RegisterEvent("GROUP_ROSTER_UPDATE")
  35.     f:RegisterEvent("UNIT_FLAGS")
  36.     f:RegisterEvent("PLAYER_FLAGS_CHANGED")
  37.     f:RegisterEvent("PLAYER_ENTERING_WORLD")
  38.     f:RegisterEvent("PARTY_LEADER_CHANGED")
  39.     f:RegisterEvent("RAID_TARGET_UPDATE")
  40.     f:RegisterEvent("PLAYER_TARGET_CHANGED")
  41.     CompactRaidFrameContainer:ClearAllPoints()
  42.     CompactRaidFrameContainer:SetParent(f)
  43.     MovAny:UnlockPoint(CompactRaidFrameContainer)
  44.     CompactRaidFrameContainer:SetPoint("TOPLEFT", CompactRaidFrameManagerContainerResizeFrame, "TOPLEFT", 4, - 7)
  45. end
  46.  
  47. function MovAny:UnlockPoint(f)
  48.     f.MAPoint = nil
  49. end
  50.  
  51. function MovAny:LockPoint(f, opt)
  52.     if not f.MAPoint then
  53.         if f:GetName() and (MovAny.lForcedLock[f:GetName()] or (opt and opt.forcedLock))  then
  54.             if not f.MASetPoint then
  55.                 f.MASetPoint = f.SetPoint
  56.                 f.SetPoint = MovAny.fVoid
  57.             end
  58.         else
  59.             if not f.MALockPointHook then
  60.                 hooksecurefunc(f, "SetPoint", MovAny.hSetPoint)
  61.                 f.MALockPointHook = true
  62.             end
  63.             f.MAPoint = {f:GetPoint(1)}
  64.         end
  65.     end
  66. end
  67.  
  68. fVoid = function() end

"MovAny:IsModified(self)" determines if the frame's position is modified or it's in the default position.

The moving functions should not be a problem, just don't let it move it in combat.

The advantage of this, when you move the Manager to another position the toggle panel button will work perfectly on that spot too.

Last edited by Resike : 01-18-14 at 12:28 PM.
  Reply With Quote