View Single Post
09-04-12, 01:43 PM   #255
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Tuller View Post
I made a request for a few more presents for Blizzard with respect to the various special action bars:
http://us.battle.net/wow/en/forum/topic/6490559996#1
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')

Last edited by p3lim : 09-04-12 at 02:31 PM.