Originally Posted by Tuller
|
Code:
local frame = CreateFrame('Frame', nil, UIParent, 'SecureHandlerStateTemplate')
frame:SetAttribute('_onstate-page', [[
print(newstate)
]])
RegisterStateDriver(frame, 'page', '[overridebar] override; [petbattle] petbattle; [form:3] cat; none')
It will print "override" equal to HasOverrideActionBar()
It will print "petbattle" when doing a petbattle
It will print "cat" when in cat form (druid)
It will print "none" if none of the above
I would like to see [tempshapeshiftbar] or something along those lines though.
Edit:
Something like this would work
(keep in mind the indexes are not correct, I just used them randomly)
Code:
local states = ''
for state, index in pairs{
['[vehicleui]'] = 1,
['[possessbar]'] = 2,
['[overridebar]'] = 3,
-- ['[tempshapeshiftbar]'] = 4,
} do
states = states .. state .. index .. ';'
end
local frame = CreateFrame('Frame', nil, UIParent, 'SecureHandlerStateTemplate')
frame:SetAttribute('_onstate-page', [[ print(newstate) ]])
RegisterStateDriver(frame, "page", states .. 'none')