BfA - How can the bag bar be moved?
I want to move this to the left side of the screen.
I tried moving MicroButtonAndBagsBar to BOTTOMLEFT of UIParent. But it doesn't work right. Any ideas? |
It might be overridden by this block of code in the file at : https://www.townlong-yak.com/framexm...ainMenuBar.lua
Code:
function MainMenuBarMixin:OnShow() Edit: D'oh just realised this is lining up the main buttons to the bag bar ... edit 2 : This definitely looks like something that may cause problems or become a problem Code:
function MainMenuBarMixin:ChangeMenuBarSizeAndPosition(rightMultiBarShowing) |
I don't really know what they're trying to do. When I try to offset it with setpoint, the mainbar starts looking smaller. Why can't blizzard just make things simple. And create as a frame that can be moved around.
Well hoping someone can figure it out. The left side makes more sense since it would fit under the chat window. And that space is probably least used by most people. |
Ok I found a workaround not sure if this creates taint or not.
Code:
MainMenuBarArtFrame.LeftEndCap:Hide() Thanks This is what it looks like https://screenshots.firefox.com/GIH5ElMPzcLmuGgf/null |
The way you can test taint, I believe, is to get in combat and see what happens when you interact or don't interact with the buttons.
I'm not sure if using the SetScale function like that is the best way to go, we used to use Hook functions/scripts for those sorts of things, but then they have changed quite a bit of their lua functionality since I last dabbled with my addons so I'm currently on a new learning curve while upgrading my addons. |
I thought about hook. Long as that code is not secure code I should be good. I'll do some more testing.
Update: You're right it did taint. I did it thru hooksecurefunction. No taint. Modified code Code:
|
I hit an issue. Once in a while in combat. The bag bar gets updated. Which causes the setscale function which is protected to give an error.
|
I'm not sure I understand it right. But hooksecure calls your code after calling the original code.
So you should not call it again in your function I think. |
The bags bar gets repositioned at any time. Even during combat. I tried making it so it only does it out of combat. But sometimes the whole bar shrinks.
You have to call SetScale() in the function. But all the code is protected the main bar and bags bar. For some reason if the bags bar is moved to the left side. Blizzard has code that will set the scale really small on the main bar. Someone must know how to work around this? |
Quote:
Lua Code:
It's in the quoted code. If the leftmost point of the microbar is on the left side of the rightmost point of the right gryphon, the bar will scale down, probably in a weird way since it's not expecting the negative offset to be that high. It's not "for some reason", it's because they're not expecting you to move the microbar to the left side. Having that said, this piece of code isn't really top notch imo. They can solve this in a better way, and while beta is still on-going, maybe you should just ask Blizzard for a less hacky way to evaluate whether the two bars overlap. Isn't it really just as easy as taking the space between the leftmost point of the left gryphon and the rightmost point of the right gryphon, adding it together with the width of the microbar and checking if it's the correct fraction of UIParent's total width? That way you would be able to put the microbar on the left side with ease. |
No matter what I do i'll have to set the position of the microbar. After their code does. And that causes a protected function call error. Which I mentioned I did make it so it would only do it out of combat.
But sometimes blizzard calls their bar code during combat. And my whole bar UI shrinks down to unusable. Very bad if that were to happen in the middle of a raid. I may just bite the bullet and recode the bar my self. Then find a way to hide the original. Just don't want to take a week or 2 figuring out how to do that. Theres no way to put the bar on the left side without causing the main bar UI to scale down. I did the offset, cause setpoint on a different point wasn't working. |
Quote:
Lua Code:
Write your own version of the function (or just copy it and run yours after), then make sure you don't call it in combat. You might have to run the code again after a multibar update though. |
Don't think this can be done reliably. Going to pass. Also blizzards current implementation of the bags bar doesn't work too well with max ui scale. So they may have to ditch it. Or change it up.
Problem is this code can run in combat. And I don't want to break the bar to make my stuff work. There is other events the bar gets called on. To make the bar work correctly. Which in turns calls the code to set the main menu bar again. Some of these things can happen in combat. Just not feasible. Thanks though, I spent too much time on this. |
Finally did it without taint. Basically had to recreate the bar. But not as hard as I thought it would be.
Someone else can make it movable or what not. UPDATE: Now handles enter/leaving a vehicle. Code:
local function CreateBagsBar() |
All times are GMT -6. The time now is 11:01 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI