View Single Post
07-04-12, 11:53 AM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
OverrideActionBar, BonusActionBar and MainMenuBar

Check this screenshot:


It shows the OverrideActionBar and the MainMenuBar both visible at the same time.

There seems to be no more BonusActionBar that swaps in the vehicle buttons on the MainMenuBar in the background.

I think Blizzard removed the bonusactionbar completly. Even actionbar switches based on form/stance seem to be gone.

Example: A warlock with Metharmorphosis...If you go into the stance the ActionBar stays the same but what does change are the ActionButtons itself.

So bar swapping based on stance/form seems to be gone. Thus the workaround with page swapping and actionbutton re-mapping can be removed (afaik).

Currently digging into it.

What's disturbing is that the PossesActionBarFrame is still alive. Not sure under which condition it can be spawned...(DK start quest orb was one of it afaik...need to test that later)

What I found is the ActionBarController.lua
Lua Code:
  1. function ActionBarController_UpdateAll()
  2.     PossessBar_Update();
  3.     StanceBar_Update();
  4.     CURRENT_ACTION_BAR_STATE = LE_ACTIONBAR_STATE_MAIN;
  5.    
  6.     -- If we have a skinned vehicle bar or skinned override bar, display the OverrideActionBar
  7.     if ((HasVehicleActionBar() and UnitVehicleSkin("player") and UnitVehicleSkin("player") ~= "")
  8.     or (HasOverrideActionBar() and GetOverrideBarSkin() and GetOverrideBarSkin() ~= "")) then
  9.         -- For now, a vehicle has precedence over override bars (hopefully designers make it so these never conflict)
  10.         if (HasVehicleActionBar()) then
  11.             OverrideActionBar_Setup(UnitVehicleSkin("player"), GetVehicleBarIndex());
  12.         else
  13.             OverrideActionBar_Setup(GetOverrideBarSkin(), GetOverrideBarIndex());
  14.         end
  15.        
  16.         CURRENT_ACTION_BAR_STATE = LE_ACTIONBAR_STATE_OVERRIDE;
  17.     -- If we have a non-skinned override bar of some sort, use the MainMenuBarArtFrame
  18.     elseif ( HasBonusActionBar() or HasOverrideActionBar() or HasVehicleActionBar() or HasTempShapeshiftActionBar() ) then
  19.         if (HasVehicleActionBar()) then
  20.             MainMenuBarArtFrame:SetAttribute("actionpage", GetVehicleBarIndex());
  21.         elseif (HasOverrideActionBar()) then
  22.             MainMenuBarArtFrame:SetAttribute("actionpage", GetOverrideBarIndex());
  23.         elseif (HasTempShapeshiftActionBar()) then
  24.             MainMenuBarArtFrame:SetAttribute("actionpage", GetTempShapeshiftBarIndex());
  25.         elseif (HasBonusActionBar() and GetActionBarPage() == 1) then
  26.             MainMenuBarArtFrame:SetAttribute("actionpage", GetBonusBarIndex());
  27.         else
  28.             MainMenuBarArtFrame:SetAttribute("actionpage", GetActionBarPage());
  29.         end
  30.        
  31.         for i=1, NUM_ACTIONBAR_BUTTONS do
  32.             local button = _G["ActionButton"..i];
  33.             ActionButton_UpdateAction(button);
  34.         end
  35.     else
  36.         -- Otherwise, display the normal action bar
  37.         ActionBarController_ResetToDefault();
  38.     end
  39.    
  40.     ValidateActionBarTransition();
  41. end

From OverrideActionBar.lua
Lua Code:
  1. function OverrideActionBar_Setup(skin, barIndex)
  2.     OverrideActionBar_SetSkin(skin);
  3.     OverrideActionBar_CalcSize();
  4.     OverrideActionBar:SetAttribute("actionpage", barIndex);
  5.    
  6.     for k=1,MAX_ALT_SPELLBUTTONS do
  7.         local button = OverrideActionBar["SpellButton"..k];
  8.         ActionButton_UpdateAction(button);
  9.         local _, spellID = GetActionInfo(button.action);
  10.         if spellID and spellID > 0 then
  11.             button:SetAttribute("statehidden", false);
  12.             button:Show();
  13.         else
  14.             button:SetAttribute("statehidden", true);
  15.             button:Hide();
  16.         end
  17.     end
  18.    
  19.     if HasVehicleActionBar() then
  20.         OverrideActionBarHealthBar:Show();
  21.         OverrideActionBarPowerBar:Show();
  22.     else
  23.         OverrideActionBarHealthBar:Hide();
  24.         OverrideActionBarPowerBar:Hide();
  25.     end
  26.  
  27.     OverrideActionBar:RegisterEvent("PLAYER_LEVEL_UP");
  28.     OverrideActionBar:RegisterEvent("PLAYER_XP_UPDATE");
  29.    
  30.     OverrideActionBar_UpdateXpBar();
  31. end

From ActionButton.lua
Lua Code:
  1. function ActionButton_UpdateAction (self)
  2.     local action = ActionButton_CalculateAction(self);
  3.     if ( action ~= self.action ) then
  4.         self.action = action;
  5.         SetActionUIButton(self, action, self.cooldown);
  6.         ActionButton_Update(self);
  7.     end
  8. end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 07-04-12 at 12:53 PM.