Thread Tools Display Modes
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.
 
07-04-12, 01:32 PM   #2
Tuller
A Warpwood Thunder Caller
 
Tuller's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 91
The possess bar is triggered at least from doing mind control as a priest (which is now called Dominate Mind, per Maul).
 
07-04-12, 01:43 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I was wondering that. But would it be the bar you get from being mind controlled or the bar the mind controller gets ?
__________________
 
07-04-12, 04:58 PM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Ok I need some help.

This is the code for my actionbar 1
Lua Code:
  1. -----------------------------
  2.   -- ACTION BUTTON CONTROLLER
  3.   -----------------------------
  4.  
  5.   local function getBarPage()
  6.     print("getting pages")
  7.     if ( HasBonusActionBar() or HasOverrideActionBar() or HasVehicleActionBar() or HasTempShapeshiftActionBar() ) then
  8.       if (HasVehicleActionBar()) then
  9.         return GetVehicleBarIndex()
  10.       elseif (HasOverrideActionBar()) then
  11.         return GetOverrideBarIndex()
  12.       elseif (HasTempShapeshiftActionBar()) then
  13.         return GetTempShapeshiftBarIndex()
  14.       elseif (HasBonusActionBar() and GetActionBarPage() == 1) then
  15.         return GetBonusBarIndex()
  16.       else
  17.         return GetActionBarPage()
  18.       end
  19.     else
  20.       return GetActionBarPage()
  21.     end
  22.   end
  23.  
  24.   for id = 1, NUM_ACTIONBAR_BUTTONS do
  25.     local button = _G["ActionButton"..id]
  26.     frame:SetFrameRef(button:GetName(), button)
  27.   end
  28.   frame:Execute(([[
  29.     buttons = table.new()
  30.     for id = 1, %s do
  31.       buttons[id] = self:GetFrameRef("ActionButton"..id)
  32.     end
  33.   ]]):format(NUM_ACTIONBAR_BUTTONS))
  34.   frame:SetAttribute('_onstate-page', ([[
  35.     if not newstate then return end
  36.     newstate = tonumber(newstate)
  37.     for id = 1, %s do
  38.       buttons[id]:SetAttribute("actionpage", newstate)
  39.     end
  40.   ]]):format(NUM_ACTIONBAR_BUTTONS))
  41.   RegisterStateDriver(frame, "page", getBarPage())

The problem is that the stateid is wrong. It is set to "page" but there is no more page-swapping, thus the statedriver does not get called as often as I need it.

If I do a /reload the correct bar will be loaded on the given value from getBarPage().

Question: Are there any other stateids that I could use?

I need to call the state driver on the following events. But how does an event correlate to a state-id?
Lua Code:
  1. event == "PLAYER_ENTERING_WORLD"
  2. event == "UPDATE_BONUS_ACTIONBAR"
  3. event == "UPDATE_VEHICLE_ACTIONBAR"
  4. event == "UPDATE_OVERRIDE_ACTIONBAR"
  5. event == "ACTIONBAR_PAGE_CHANGED"


The best solution I came up with is:

Lua Code:
  1. local function getPage()
  2.     print("getting pages")
  3.     if ( HasBonusActionBar() or HasOverrideActionBar() or HasVehicleActionBar() or HasTempShapeshiftActionBar() ) then
  4.       if (HasVehicleActionBar()) then
  5.         return GetVehicleBarIndex()
  6.       elseif (HasOverrideActionBar()) then
  7.         return GetOverrideBarIndex()
  8.       elseif (HasTempShapeshiftActionBar()) then
  9.         return GetTempShapeshiftBarIndex()
  10.       elseif (HasBonusActionBar() and GetActionBarPage() == 1) then
  11.         return GetBonusBarIndex()
  12.       else
  13.         return GetActionBarPage()
  14.       end
  15.     else
  16.       return GetActionBarPage()
  17.     end
  18.   end
  19.  
  20.   for id = 1, NUM_ACTIONBAR_BUTTONS do
  21.     local button = _G["ActionButton"..id]
  22.     frame:SetFrameRef(button:GetName(), button)
  23.   end
  24.  
  25.   frame:SetScript("OnEvent", function(self, event)
  26.     frame:Execute(([[
  27.       buttons = table.new()
  28.       for id = 1, %s do
  29.         buttons[id] = self:GetFrameRef("ActionButton"..id)
  30.         buttons[id]:SetAttribute("actionpage", %s)
  31.       end
  32.     ]]):format(NUM_ACTIONBAR_BUTTONS, getPage()))
  33.   end)
  34.  
  35.   frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  36.   frame:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
  37.   frame:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR")
  38.   frame:RegisterEvent("UPDATE_OVERRIDE_ACTIONBAR")
  39.   frame:RegisterEvent("ACTIONBAR_PAGE_CHANGED")

That actually works. But as soon as I exit the vehicle in combat I get a totally wierd taint.

Code:
7/5 00:54:45.243  Global variable rGetPoint tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:12
7/5 00:54:45.243  Global variable rResetToDefaultPoint tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:23
7/5 00:54:45.243  Global variable rResetToPoint tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:30
7/5 00:54:45.243  Global variable rUnlockFrame tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:43
7/5 00:54:45.243  Global variable rLockFrame tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:58
7/5 00:54:45.243  Global variable rUnlockAllFrames tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:71
7/5 00:54:45.243  Global variable rLockAllFrames tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:80
7/5 00:54:45.243  Global variable rResetAllFramesToDefault tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:89
7/5 00:54:45.243  Global variable rCreateDragFrame tainted by rLib - Interface\AddOns\rLib\core\dragframe.lua:98
7/5 00:54:45.243  Global variable rCreateSlashCmdFunction tainted by rLib - Interface\AddOns\rLib\core\slashcmd.lua:14
7/5 00:54:45.243  Global variable rButtonBarFader tainted by rLib - Interface\AddOns\rLib\core\fader.lua:15
7/5 00:54:45.243  Global variable rFrameFader tainted by rLib - Interface\AddOns\rLib\core\fader.lua:32
7/5 00:54:45.243  Global variable SLASH_rabs1 tainted by rActionBarStyler - Interface\AddOns\rActionBarStyler\core\slashcmd.lua:24
7/5 00:54:45.321  Global variable ACTIVE_CHAT_EDIT_BOX tainted by rActionBarStyler - Interface\FrameXML\ChatFrame.lua:3782 ChatEdit_DeactivateChat()
7/5 00:54:45.321      Interface\FrameXML\InterfaceOptionsPanels.lua:981 InterfaceOptionsSocialPanelChatStyle_SetChatStyle()
7/5 00:54:45.321      Interface\FrameXML\InterfaceOptionsPanels.lua:907
7/5 00:54:45.321  Execution tainted by rActionBarStyler while reading ACTIVE_CHAT_EDIT_BOX - Interface\FrameXML\ChatFrame.lua:3781 ChatEdit_DeactivateChat()
7/5 00:54:45.321      Interface\FrameXML\ChatFrame.lua:3727 ChatEdit_OnEditFocusLost()
7/5 00:54:45.321      ChatFrame1EditBox:OnEditFocusLost()
7/5 00:54:45.321      ChatFrame1EditBox:ClearFocus()
7/5 00:54:45.321      Interface\FrameXML\ChatFrame.lua:3769 ChatEdit_SetDeactivated()
7/5 00:54:45.321      Interface\FrameXML\ChatFrame.lua:3785 ChatEdit_DeactivateChat()
7/5 00:54:45.321      Interface\FrameXML\InterfaceOptionsPanels.lua:981 InterfaceOptionsSocialPanelChatStyle_SetChatStyle()
7/5 00:54:45.321      Interface\FrameXML\InterfaceOptionsPanels.lua:907
How can I get a taint from my own lib?

The only thing that I could think of that nets me the taint is calling SetAttribute on the button inside EXECUTE...but how should I do it otherwise?
__________________
| 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-05-12 at 01:37 AM.
 
 

WoWInterface » Site Forums » Archived Beta Forums » MoP Beta archived threads » OverrideActionBar, BonusActionBar and MainMenuBar

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