View Single Post
04/19/14, 02:04 PM   #5
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
Okay, here's how it goes. The function to put a button (or button group) to the keybind bar is as follows:
Code:
KEYBIND_STRIP:AddKeybindButtonGroup(keybindStripDescriptor)
...where keybindStripDescriptor is as follows:
Code:
local keybindStripDescriptor = 
{
	{ -- I think you can have more than one button in your group if you add more of these sub-groups
		alignment = KEYBIND_STRIP_ALIGN_CENTER,
		name = "Craft All",
		keybind = "UI_SHORTCUT_TERTIARY",
		callback = function() CookAllStart() end,
	},
}
Put the first segment of code in your callback for the event that displays the keybind bar. In your callback for the event that un-displays the keybind bar (ie, EVENT_END_CRAFTING_STATION_INTERACT), put this line:
Code:
KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
I think there might be a more graceful way to do it when there's already some buttons there, but this is one way to do it.
  Reply With Quote