As it turned out, there was a taint that was possible with the previous code.
I have completely rectified this and tested the hell out of it in several really weird edge cases and as far as I can tell, no taint. If anyone is interested in the code to alleviate the lack of button population in certain circumstances, you may find it here:
Lua Code:
--[[
Assess whether the attribute that was changed and triggered the blizzard _onattributechanged event was the 'statehidden' attribute
Assess whether the player has an OverrideActionBar or VehicleActionBar
If they do, determine if the 6 (< 7) OverrideActionBarButtons which are used for VehicleActionBar, too, are hidden or not
If the player has a special bar and the OverrideActionBarButton is hidden, also hide the respective ActionButton that is part of the paging bar
However, if they have a special bar but the OverrideActionBarButton is shown, also show the respective ActionButton that is part of the paging bar
Hide the ActionButtons7-12 if the player has a special bar
If the player doesn't have an OverrideActionBar nor VehicleActionBar, show ActionButtons1-12 that are part of the paging bar
]]--
local _onAttributeChanged = [[
if name == 'statehidden' then
if (HasOverrideActionBar() or HasVehicleActionBar()) then
for i = 1, 12 do
if i < 7 then
if overridebuttons[i]:GetAttribute('statehidden') then
buttons[i]:SetAttribute('statehidden', true)
buttons[i]:Hide()
else
buttons[i]:SetAttribute('statehidden', false)
buttons[i]:Show()
end
else
buttons[i]:SetAttribute('statehidden', true)
buttons[i]:Hide()
end
end
else
for i = 1, 12 do
buttons[i]:SetAttribute('statehidden', false)
buttons[i]:Show()
end
end
end
]]
--[[
Generate a secure frame, AttributeChangedFrame, that is used to 'hook' into the _onattributechanged
Set frame references for both the ActionButtons and the OverrideActionBarButtons, which are used for both VehicleActionBar and OverrideActionBar bars
Make two secure tables, buttons and overridebuttons; populate it with the buttons using the just set frame references
'Hook' our secure frame to run the secure _onAttributeChanged snippet when the blizzard event, _onattributechanged, fires
Finish by registering the secure frame as a secure state driver, because for some reason this is required for the _onattributechanged to properly be hooked
]]--
local AttributeChangedFrame = CreateFrame('Frame', nil, UIParent, 'SecureHandlerAttributeTemplate')
for i = 1, 12 do
local button = _G['ActionButton'..i]
AttributeChangedFrame:SetFrameRef('ActionButton'..i, button)
end
for i = 1, 6 do
local overrideButton = _G['OverrideActionBarButton'..i]
AttributeChangedFrame:SetFrameRef('OverrideActionBarButton'..i, overrideButton)
end
AttributeChangedFrame:Execute([[
buttons = table.new()
for i = 1, 12 do
buttons[i] = self:GetFrameRef('ActionButton'..i)
end
overridebuttons = table.new()
for j = 1, 6 do
overridebuttons[j] = self:GetFrameRef('OverrideActionBarButton'..j)
end
]])
AttributeChangedFrame:SetAttribute('_onattributechanged', _onAttributeChanged)
RegisterStateDriver(AttributeChangedFrame, 'visibility', '[overridebar][shapeshift][vehicleui][possessbar] show; hide')
I've put in a bunch of documentation for why I did what I did. One thing I can't resolve, is why I need to RegisterStateDriver for visibility for the :SetAttribute('_onattributechanged', _onAttributeChanged) to actually fire. Without this RegisterStateDriver(...) line, this doesn't happen. Is there anyone who can explain that finding?