Improved Blizzard UI

Improved Blizzard UI

161k Downloads

BfA Action Bars Issue

kaytotes opened this issue ยท 1 comments

commented

I'm going to be using this as a central reference point for other issues.

So basically on the PTR I had neither tested Dungeons, Raids, Battlegrounds or did much messing around with combat (for example logging in whilst already in combat, something which usually happens in Instance combat).

There have been a bunch of issues related to the Action Bars since 8.0 came out. Blizzard obviously squished and restructured them and in the process completely overhauled the code to use their new mixins etc.

Long story short, the new implementation by Blizzard essentially calls and attempts to reset the UI constantly in combat. For the most trivial of things.

The issue however is that calling essentially anything but in this case specifically SetSize on frames such as the MainMenuBar and MainMenuBarArtFrameBackground are considered protected during combat. This was not the case prior to BfA. Due to this the UI is constantly breaking and trying to go back to it's "large" state if you have 3 action bars.

Due to this as it stands the only real way I'd be able to "fix" this is to completely write my own Action Bars implementation and no longer rely on Blizzards at all.

I will be doing this as I frankly despise the new "squished yet still big" bars. However, for now the only recourse for a consistent is to fall back to just allowing Blizzard to handle that.

What will be staying

  • Out of Range Indicator.
  • Customizable Texts.
  • Micro Menu and Bags Hidden (Show with Mini Map Menu).

In the mean time, I'll be gutting this and releasing a build onto WoWInterface and Curse asap.

commented

Hello there!
Posting a potential solution for the BottomRightActionBar headache.
We need to disable Blizzard's ability to call setpoint on the actionbar's button7 AFTER we change the position to make it back into a single bar. Similarly we need to disable their ability to move ActionButton1 to prevent the frame from bouncing back and forth with combat events. Since this removes the SetPoint function, the protected blizzard code calls a NIL function, which doesn't cause any errors and prevents it from moving the frames around. Your old 3 stack actionbar code should work just fine if you add these two lines after moving the bars:

ActionButton1.SetPoint = function() end
MultiBarBottomRightButton7.SetPoint = function() end  

If we still need the SetPoint function for our own purposes we can steal it into another variable before making this change:

barPoint=MultiBarBottomRightButton7.SetPoint

EDIT:

Another solution has come to mind reading the BlizzardInterfaceCode:
https://github.com/tomrus88/BlizzardInterfaceCode/blob/f0aa5d5bc0a510543f957672613095586e83ce4b/Interface/FrameXML/UIParent.lua#L2924

By using SetUserPalced(true) we can trick that conditional into thinking that the actionbar has been moved by the user and not to touch it:

MainMenuBar:SetMovable(true)
MainMenuBar:SetUserPlaced(true)
MainMenuBar:SetMovable(false)

This would of course only stop the bars bouncing around with combat events.

Edit2:

I've been testing this code, which seems to be working without issues for repositioning the actionbars into an evenly spaced grid (for my setup, which is a bit different than your setup prior to 8.0) This however does not handle centering the action bars horizontally...

--ActionBars.lua
--Disable this after ImprovedBlizzardUI gets fixed...
local f = CreateFrame("Frame", nil, UIParent)
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(self, event)
	MainMenuBar:ClearAllPoints()
	MainMenuBar:SetPoint("BOTTOM")
	ActionBarUpButton:Hide()
	ActionBarDownButton:Hide()
	MainMenuBar:SetMovable(true)
	MainMenuBar:SetUserPlaced(true)
	MainMenuBar:SetMovable(false)
	MultiBarBottomLeftButton1:ClearAllPoints()
	MultiBarBottomLeftButton1:SetPoint("BOTTOMLEFT",ActionButton1,"TOPLEFT",0,5)
	MultiBarBottomLeftButton1.SetPoint = function() end
	MultiBarBottomLeft.SetPoint = function() end
	MultiBarBottomRightButton1:ClearAllPoints()
	MultiBarBottomRightButton1:SetPoint("BOTTOMLEFT",MultiBarBottomLeftButton1,"TOPLEFT",0,5)
	MultiBarBottomRightButton1.SetPoint = function() end
	MultiBarBottomRight.SetPoint = function() end
	MultiBarBottomRightButton7:ClearAllPoints()
	MultiBarBottomRightButton7:SetPoint("LEFT",MultiBarBottomRightButton6,"RIGHT",5,0)
	MultiBarBottomRightButton7.SetPoint = function() end 
	f:UnregisterAllEvents()
end)



local function CenterActionBars()
   MainMenuBar:ClearAllPoints()
   MainMenuBar:SetPoint("BOTTOM")
end

hooksecurefunc("MultiActionBar_Update", CenterActionBars)

It's a bit kludgey because I'm not a lua developer, but it works through combat changes etc...