View Single Post
08-02-16, 04:21 AM   #1
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Need help with micromenu moving script while in vehcile menu

Since prepatch I am having issue with micromenu moving script when entering vehicles, it seems to work ok out of combat, but when i enter a vehicle menu in combat, it has some troubles with working properly, i made a quick video to illustrate this issue, and script is below.

https://youtu.be/1ItYG7JrgYQ?t=6

Lua Code:
  1. local function SetPoint(frame)
  2.     if frame.lockPoint then
  3.         local p = frame.lockPoint
  4.         frame.lockPoint = nil
  5.         frame:ClearAllPoints()
  6.         frame:SetPoint(unpack(p))
  7.         frame.lockPoint = p
  8.     end
  9. end
  10.  
  11. local function LockPoint(frame)
  12.     if not frame.lockPoint then
  13.         if not frame.lockPointHook then
  14.             hooksecurefunc(frame, "SetPoint", function(self)
  15.                 SetPoint(self)
  16.             end)
  17.             frame.lockPointHook = true
  18.         end
  19.         frame.lockPoint = {frame:GetPoint(1)}
  20.     end
  21. end
  22.  
  23. local function UnlockPoint(frame)
  24.     frame.lockPoint = nil
  25. end
  26.  
  27. local children = {
  28.     CharacterMicroButton,
  29.     SpellbookMicroButton,
  30.     TalentMicroButton,
  31.     AchievementMicroButton,
  32.     QuestLogMicroButton,
  33.     GuildMicroButton,
  34.     LFDMicroButton,
  35.     CollectionsMicroButton,
  36.     EJMicroButton,
  37.     StoreMicroButton,
  38.     MainMenuMicroButton
  39. }
  40.  
  41. CharacterMicroButton:ClearAllPoints()
  42. CharacterMicroButton:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 806, 2)
  43.  
  44. for i = 1, #children, 1 do
  45.     LockPoint(children[i])
  46. end
  47.  
  48. OverrideActionBar:HookScript("OnShow", function(self)
  49.     for i = 1, #children, 1 do
  50.         UnlockPoint(children[i])
  51.         children[i]:ClearAllPoints()
  52.         if i == 1 then
  53.             children[i]:SetPoint("LEFT", OverrideActionBarLeaveFrame, "LEFT", - 170, 20)
  54.         elseif children[i] == LFDMicroButton then
  55.             children[i]:SetPoint("LEFT", CharacterMicroButton, "LEFT", 0, - 34)
  56.         else
  57.             children[i]:SetPoint("LEFT", children[i - 1], "RIGHT", - 3, 0)
  58.         end
  59.         LockPoint(children[i])
  60.     end
  61. end)
  62.  
  63. OverrideActionBar:HookScript("OnHide", function(self)
  64.     for i = 1, #children, 1 do
  65.         UnlockPoint(children[i])
  66.         children[i]:ClearAllPoints()
  67.         if i == 1 then
  68.             children[i]:SetPoint( "BOTTOMLEFT", UIParent, "BOTTOMLEFT", 806, 2)
  69.         else
  70.             children[i]:SetPoint("LEFT", children[i - 1], "RIGHT", - 3, 0)
  71.         end
  72.         LockPoint(children[i])
  73.     end
  74. end)
  75.  
  76. PetBattleFrame:HookScript("OnShow", function(self)
  77.     for i = 1, #children, 1 do
  78.         UnlockPoint(children[i])
  79.         children[i]:ClearAllPoints()
  80.         if i == 1 then
  81.             children[i]:SetPoint("LEFT", OverrideActionBarLeaveFrame, "LEFT", - 143, 20)
  82.         elseif children[i] == LFDMicroButton then
  83.             children[i]:SetPoint("LEFT", CharacterMicroButton, "LEFT", 0, - 34)
  84.         else
  85.             children[i]:SetPoint("LEFT", children[i - 1], "RIGHT", - 3, 0)
  86.         end
  87.         LockPoint(children[i])
  88.     end
  89. end)
  90.  
  91. PetBattleFrame:HookScript("OnHide", function(self)
  92.     for i = 1, #children, 1 do
  93.         UnlockPoint(children[i])
  94.         children[i]:ClearAllPoints()
  95.         if i == 1 then
  96.             children[i]:SetPoint( "BOTTOMLEFT", UIParent, "BOTTOMLEFT", 806, 2)
  97.         else
  98.             children[i]:SetPoint("LEFT", children[i - 1], "RIGHT", - 3, 0)
  99.         end
  100.         LockPoint(children[i])
  101.     end
  102. end)

Buggrabber shows:

Code:
[ADDON_ACTION_BLOCKED] AddOn 'EVUI' tried to call the protected function 'MultiBarBottomLeft:Show()'.
[12:48:25] Interface\AddOns\!BugGrabber\BugGrabber.lua:573: in function <Interface\AddOns\!BugGrabber\BugGrabber.lua:573>
[C]: in function `Show'
Interface\FrameXML\MultiActionBars.lua:37: in function `MultiActionBar_Update'
Interface\FrameXML\ActionBarController.lua:174: in function `ValidateActionBarTransition'
Interface\FrameXML\ActionBarController.lua:142: in function `ActionBarController_UpdateAll'
Interface\FrameXML\ActionBarController.lua:64: in function <Interface\FrameXML\ActionBarController.lua:53>

Last edited by mich125 : 08-02-16 at 04:50 AM.
  Reply With Quote