Wow .. all I had to do was monitor for a couple of events and then do a secure execute snippet to update the buttons again .. I suppose it is all a learning curve
The first time round it doesn't need to do it as the initial state-page change has the same code. Any additional calls to update the bars just asks for the page as last set and updates all the buttons again.
Works flawlessly with Big Boom quest and doesn't affect stance bar changes rofl.
Lua Code:
elseif event == "UPDATE_VEHICLE_ACTIONBAR" or event == "UPDATE_OVERRIDE_ACTIONBAR" then
nUI_ActionBar:Execute(([[
local page = self:GetAttribute('state-page')
if not page then return end
local pageOffset, hasAction = (page - 1) * NUM_ACTIONBAR_BUTTONS
for id = 1, #ActionButtons do
if HasAction(id + pageOffset) then
ActionButtons[id]:SetAttribute('actionpage', page)
hasAction = true
else
ActionButtons[id]:SetAttribute('actionpage', nil)
end
end
if not hasAction then
self:SetAttribute('state-page', nil)
end
]]):gsub('NUM_ACTIONBAR_BUTTONS', NUM_ACTIONBAR_BUTTONS))
end