WoW:Using bindings.xml to create key bindings for your addon

From AddOn Studio
Revision as of 12:21, 13 November 2004 by WoWWiki>Sarf
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Example:

<Bindings>
	<Binding name="DOSTUFF" description="Default description" header="MYDOSTUFF">
		DoSomething();
	</Binding>
	<Binding name="DOOTHERSTUFF" description="Other default description">
		if ( keystate == "down" ) then
			DoSomethingElse();
		else
			DoSomethingYetDifferent();
		end
	</Binding>
</Bindings>

Three things.

WoW starts a new header when it finds a header="MYDOSTUFF" in a binding definition. You can not "hook into" a previous header using this way.

WoW tries to look for a lua variable BINDING_HEADER_MYDOSTUFF if you use header="MYDOSTUFF". If it can not find that, your binding will end up with the previous header.

if you use name="DOSTUFF" then WoW tries to look for a lua variable named BINDING_NAME_DOSTUFF. If that is not found, it uses description. If description is not present, it uses the name. This last case will look ugly.