View Single Post
03-23-19, 11:44 AM   #8
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
Originally Posted by siweia View Post
I am fine with button 7-12 showing on vehicle bar.
Would that work if I just keep the second part of the code?
If I'm understanding you correctly, you want your paged action bar's buttons 7-12 to still show if you enter a vehicle/override bar state. If so, try replacing the _onAttributeChanged secure snippet with this:

Lua Code:
  1. local _onAttributeChanged = [[
  2.     if name == 'statehidden' then
  3.         if (HasOverrideActionBar() or HasVehicleActionBar()) then
  4.             for i = 1, 12 do
  5.                 if i < 7 then
  6.                     if overridebuttons[i]:GetAttribute('statehidden') then
  7.                         buttons[i]:SetAttribute('statehidden', true)
  8.                         buttons[i]:Hide()
  9.                     else
  10.                         buttons[i]:SetAttribute('statehidden', false)
  11.                         buttons[i]:Show()
  12.                     end
  13.                 else
  14.                     buttons[i]:SetAttribute('statehidden', false)
  15.                     buttons[i]:Show()
  16.                 end
  17.             end
  18.         else
  19.             for i = 1, 12 do
  20.                 buttons[i]:SetAttribute('statehidden', false)
  21.                 buttons[i]:Show()
  22.             end
  23.         end
  24.     end
  25. ]]

If not, please give me more detail so I can help you better
  Reply With Quote