Thread Tools Display Modes
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
08-02-16, 04:50 AM   #2
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Is the issue still happens with every other addon, mostly your action bar addon disabled too?
  Reply With Quote
08-02-16, 04:53 AM   #3
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Originally Posted by Resike View Post
Is the issue still happens with every other addon, mostly your action bar addon disabled too?
I only have few scripts, for moving hiding stuff like:

Code:
MultiBarBottomLeft:ClearAllPoints()
MultiBarBottomLeft:SetPoint("BOTTOMLEFT","UIParent","BOTTOMLEFT",272,45)
MultiBarBottomLeft:SetScale(1)
MultiBarBottomLeft.SetPoint = function() end

MultiBarBottomRight:ClearAllPoints()
MultiBarBottomRight:SetPoint("BOTTOMLEFT","UIParent","BOTTOMLEFT",784,45)
MultiBarBottomRight:SetScale(1)
MultiBarBottomRight.SetPoint = function() end
Will try to disable everyting and try only with micromenu script tho
  Reply With Quote
08-02-16, 05:22 AM   #4
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Damn it seems to be exactly that, whats cousing my issue:

Code:
MultiBarBottomLeft:ClearAllPoints()
MultiBarBottomLeft:SetPoint("BOTTOMLEFT","UIParent","BOTTOMLEFT",272,45)
MultiBarBottomLeft:SetScale(1)
MultiBarBottomLeft.SetPoint = function() end

MultiBarBottomRight:ClearAllPoints()
MultiBarBottomRight:SetPoint("BOTTOMLEFT","UIParent","BOTTOMLEFT",784,45)
MultiBarBottomRight:SetScale(1)
MultiBarBottomRight.SetPoint = function() end
Any way to fix it?
  Reply With Quote
08-02-16, 06:30 AM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Remove the OnShow scripts of MainMenuBar.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
08-02-16, 07:26 AM   #6
mich125
A Fallenroot Satyr
Join Date: Jan 2010
Posts: 27
Ok all works fine again, thanks guys
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need help with micromenu moving script while in vehcile menu


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