View Single Post
10-15-10, 03:08 AM   #2
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
But how is the reference between the default buttons and the new bar being made? I see "SetFrameRef", "Execute" and "SetAttribute("_onstate-page"," but actually I don't understand what they do.
Code:
local button
		for i = 1, NUM_ACTIONBAR_BUTTONS do
			button = _G["ActionButton"..i]
			self:SetFrameRef("ActionButton"..i, button) -- creates frame "ActionButtonX" reference in secure environment
		end	

		self:Execute([[ -- executes the snippet in the secure env
			buttons = table.new()
			for i = 1, 12 do
				table.insert(buttons, self:GetFrameRef("ActionButton"..i))
			end  -- creates new table in secure environment and fills it with action button frames retrieving them by frame reference


		]])

		self:SetAttribute("_onstate-page", [[ 
			for i, button in ipairs(buttons) do
				button:SetAttribute("actionpage", tonumber(newstate))
			end -- State driver updates "page" attribute based on macro conditionals.  "_onstate-page" is called and newstate contains new actionbar page number.
		]])
what i fail to understand is why would you do something like that to default action bars. they're already doing this... Because of damn taint probably

Last edited by d87 : 10-15-10 at 03:16 AM.