Compact Action Bar

Compact Action Bar

21.7k Downloads

Main action bar does not switch page when entering a different combat stance.

danbar74 opened this issue ยท 4 comments

commented

After installing v 1.2.0, main action bar shows always "caster" form actions, even after shifting to cat/bear form.

commented

Thanks for the report - I have leveled a druid alt to 10 and yes, I can see that the main bar stays unchanged when switching to the bear stance.

I will investigate what causes that and keep you updated when I have a fix available.

commented

I have identified the cause - it comes from changing the parent frame of action buttons from the main menu bar to a custom container, which I added to make it easier for me to hide them. I will work around that.

It will be fixed in the next update, very likely early next week in a patch with fixes and some more code cleanup.

Here's the cause:

local TargetParentRelations = {
-- Left frame children
CompactActionBarLeftBarFrame = {
MainMenuBarTexture0,
MainMenuBarTexture1,
ActionButton1,
ActionButton2,
ActionButton3,
ActionButton4,
ActionButton5,
ActionButton6,
ActionButton7,
ActionButton8,
ActionButton9,
ActionButton10,
ActionButton11,
ActionButton12,
},

-- Set parent frames
for ContainerFrame, TargetChildren in pairs(TargetParentRelations) do
for i, Frame in pairs(TargetChildren) do
Frame:SetParent(ContainerFrame)
end
end

commented

I dived deeper into this and found that action buttons derive the ID of the currently shown page from their's parent frame. What I did to avoid changing the addon structure is hooking into a function called on the stance change, copy over actionpage attribute to my custom frame for buttons, and then update the buttons - works flawlessly!

That fix will be included in the next version, will close the issue when it's out.

  -- Fixes the bar not updating page with stance change
  hooksecurefunc("ActionBarController_UpdateAll", function(force)
    -- Get the actionpage from art frame and set it to buttons parent
    self.CompactActionBarLeftBarFrame:SetAttribute("actionpage", MainMenuBarArtFrame:GetAttribute("actionpage"))

    -- Force update on all action buttons
    for k, Frame in pairs(ActionBarButtonEventsFrame.frames) do
      ActionButton_UpdateAction(Frame, force);
    end
  end)
commented

Tested the fix during a raid, it was causing some other errors. Decided to simply restore the way bars were hidden in prior versions, which works just fine.

This also affected rogue stealth stance, as confirmed by a guildie, and probably warrior battle stances too.

Version 1.2.1 fixes the problem.

If the bug reoccurs in the future, please reopen the issue!