Thread Tools Display Modes
03-26-21, 12:22 PM   #1
yess
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 29
MainMenuBar glitches

I am trying to move the MainMenuBar above a libdatabroker display (ChocolateBar).

But the MainMenuBar is constantly reset somewhere in Blizzards code. Now I know that I can avoid this by setting it to user placed:

Code:
MainMenuBar:SetUserPlaced(true)
but that causes the MainMenuBar become non intractable after leaving a vehicle during combat.

I have tried to set it back to not user placed when entering a vehicle to avoid this (as does TitanPanel) but its still glitching sometimes if I enter a vehicle several times during a combat. Probably because UNIT_ENTERING_VEHICLE / UNIT_EXITED_VEHICLE also triggers PLAYER_REGEN_DISABLED and PLAYER_REGEN_DISABLED despite a continuous combat situation...

Has anyone more insight on what is going on with the MainMenuBar's placement in the first place? And why is it non clickable if SetUserPlaced is still true when entering/leaving a vehicle?
  Reply With Quote
03-26-21, 12:28 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Doesn't ChocolateBar have this built in by using the Jostle library?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-26-21, 01:42 PM   #3
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Originally Posted by yess View Post
I am trying to move the MainMenuBar above a libdatabroker display (ChocolateBar).

But the MainMenuBar is constantly reset somewhere in Blizzards code. Now I know that I can avoid this by setting it to user placed


Try also adding this:
Code:
        MainMenuBar:SetMovable(true)
        MainMenuBar.ignoreFramePositionManager = true
__________________
AddOns: Tim @ WoWInterface
Characters: Mage, Priest, Devoker, Pally
Battle Tag: Mysterio#11164
Current PC Setup: PCPartPicker List
  Reply With Quote
03-26-21, 03:55 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
nUI hooks into various functions after Blizzard does its stuff to move things back to where we want them.

-- Reparent, move and allow user placement changes made here
hooksecurefunc("UpdateMicroButtonsParent",....)

-- Used for scaling buttons to our chosen size
hooksecurefunc("MoveMicroButtons", ...)

-- Used to adjust placement of the arrow tip added to "MicroButtons" info system
hooksecurefunc(HelpTip,"Show",....)

Not sure if any of them will help you with what you want to do but you never know.
__________________
  Reply With Quote
03-26-21, 04:41 PM   #5
yess
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 29
Originally Posted by Seerah View Post
Doesn't ChocolateBar have this built in by using the Jostle library?
It used to, I tried to maintain it since 2016, but eventually I stopped because I did to not want to cause glitches for others using the lib.

Originally Posted by Tim View Post
Try also adding this:
Code:
        MainMenuBar:SetMovable(true)
        MainMenuBar.ignoreFramePositionManager = true
Thanks I will try that!

Originally Posted by Xrystal View Post
nUI hooks into various functions after Blizzard does its stuff to move things back to where we want them.

-- Reparent, move and allow user placement changes made here
hooksecurefunc("UpdateMicroButtonsParent",....)

-- Used for scaling buttons to our chosen size
hooksecurefunc("MoveMicroButtons", ...)

-- Used to adjust placement of the arrow tip added to "MicroButtons" info system
hooksecurefunc(HelpTip,"Show",....)

Not sure if any of them will help you with what you want to do but you never know.
Thanks I will look into this and nUI

Last edited by yess : 03-26-21 at 04:45 PM.
  Reply With Quote
03-28-21, 04:16 PM   #6
yess
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 29
Code:
MainMenuBar.ignoreFramePositionManager = true
did not help much unfortunately. The MainMenuBar would still be reset constantly.

The glithc with the MainMenuBar not being clickable was that when I call

Code:
MainMenuBar:SetUserPlaced(true)
Blizzards code then does not properly set the MainMenuBar after leaving a vehicle but it is shown, as not clickable. MainMenuBar:GetRight() returns nil then. Maybe it is still hidden. I actually can fix it with setting its points.

Code:
MainMenuBar:SetPoints(...
But only after combat ends of course, so that is not a fix.

Anyway, the fix I came up with was to set SetUserPlaced back to false when entering a vehicle. And if in combat then wait until end of combat before moving the MainMenuBar and setting SetUserPlaced to true again.

What I missed though is that that I used the event UNIT_ENTERING_VEHICLE to set SetUserPlaced(false). But that is too early because PLAYER_REGEN_ENABLED is triggered after that despite still in combat and I had that hocked to call SetUserPlaced(true) again....
  Reply With Quote
03-28-21, 05:50 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
If you want to catch changes to combat mode to apply settings before combat then I would use PLAYER_REGEN_DISABLED and then reverse it out on PLAYER_REGEN_ENABLED.

I use these to stop interactions during combat that players may be tempted to do or to minimise/hide non combat windows during combat. PLAYER_REGEN_DISABLED may trigger after UNIT_ENTERING_VEHICLE or before. Similarly PLAYER_REGEN_ENABLED may trigger before UNIT_EXITING_VEHICLE or after.

Not too much helpful but they may be events you hadn't considered before.
__________________
  Reply With Quote
03-29-21, 03:06 AM   #8
Taudier
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 53
this question came many times, here is an addon https://www.wowinterface.com/downloa...inMenuBar.html

Last edited by Taudier : 03-29-21 at 05:30 AM.
  Reply With Quote
03-29-21, 08:24 AM   #9
yess
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 29
Originally Posted by Xrystal View Post
If you want to catch changes to combat mode to apply settings before combat
No that is not what I want.

Originally Posted by Xrystal View Post
PLAYER_REGEN_DISABLED may trigger after UNIT_ENTERING_VEHICLE or before. Similarly PLAYER_REGEN_ENABLED may trigger before UNIT_EXITING_VEHICLE or after.
You misunderstood. Yes these events can fire after you entered and vehicle if your combat status changes.
The interesting part is that they trigger EVERY time when you enter a vehicle DURING a combat situation.

So the sequence of of the events when entering a vehicle is:

Player not in combat:
UNIT_ENTERING_VEHICLE
UNIT_ENTERED_VEHICLE

Player pulls and after that enters a vehicle:

PLAYER_REGEN_DISABLED <-- player pulled
UNIT_ENTERING_VEHICLE
PLAYER_REGEN_ENABLED --> this here caused my function MoveAndLockMainMenuBar() (called by a timer), to occasionally set MainMenuBar:SetUserPlaced(true) as InCombatLockDown() and UnitInVehicle("Player") booth returns false! In this stage!
PLAYER_REGEN_DISABLED
UNIT_ENTERED_VEHICLE
...
UNIT_EXITING_VEHICLE
... --blizzards code repositions the MainMenuBar and it breaks due to MainMenuBar:SetUserPlaced(true)
UNIT_EXITED_VEHICLE
PLAYER_REGEN_ENABLED (combat actually ended and we are not in a vehicle) --> MoveAndLockMainMenuBar()

Originally Posted by Xrystal View Post
Not too much helpful but they may be events you hadn't considered before.
Yeah, I ended up using UNIT_EXITING_VEHICLE to unlock the action bar:

Code:
function ChocolateBar:UNIT_EXITING_VEHICLE()
	MainMenuBar:SetMovable(true)
	MainMenuBar:SetUserPlaced(false)
	MainMenuBar:SetMovable(false)
end

-- between these events blizzards code will reposition the MainMenuBar
-- and as SetUserPlaced is false, it will not break 

function ChocolateBar:UNIT_EXITED_VEHICLE()
        -- MoveAndLockMainMenuBar()
        -- this will schedule the repositioning and check every n seconds if combat has ended and it is save to move the bar again
	self:Refresh(MainMenuBar, PlayerFrame) 
end
The downside is that until combat ends the action bar (MainMenuBar) will continue to be positioned wrong (bottom at the screen above the bottom ChocolateBar).

Easy fix for my initial problem but what a headache to find this out
  Reply With Quote
03-29-21, 08:25 AM   #10
yess
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2008
Posts: 29
Originally Posted by Taudier View Post
this question came many times, here is an addon https://www.wowinterface.com/downloa...inMenuBar.html
Not sure what this does. I do not understand the description of that mod.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » MainMenuBar glitches

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