WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Binding a key directly to a companion (https://www.wowinterface.com/forums/showthread.php?t=36785)

kraftman 11-16-10 12:03 PM

Binding a key directly to a companion
 
I'm trying to allow users of my addon to directly bind keys to companions.

SetBindingSpell("key", "spell name") doesn't seem to work, SetBindingSpell("key", "spellID") seems to set the spell properly, in that GetSpellTexture(GetBindingAction("key")) returns the correct texture for the spell, however pressing the key doesn't call the companion.

Is there another way to do this that doesn't involve either creating a macro, or creating a button?

Phanx 11-16-10 04:39 PM

SetBindingSpell requires a spell name to work; giving it a spell ID won't generate any errors, but it won't work either.

It looks like the answer to your question, though, is that you cannot directly keybind companions (or mounts).

Coote 11-16-10 05:46 PM

You can check out ncHoverBind and see how it's done there (it SHOULD work, though I haven't had the chance to really test it). If you find it of any use, you're welcome to try replicating it to work with your addon.

Xchg 11-16-10 07:09 PM

Not an ideal solution, since the buttons can shift around, but you could do something like:

SetBindingClick("Q", "SpellBookCompanionButton1")

Would require some extra work to check what's currently in that slot.

Sojik 11-22-10 04:40 PM

Quote:

Originally Posted by Xchg (Post 218141)
Not an ideal solution, since the buttons can shift around, but you could do something like:

SetBindingClick("Q", "SpellBookCompanionButton1")

Would require some extra work to check what's currently in that slot.

That will only work one the first page. All subsequent pages reuse those buttons. Oh well, it would have been pretty messy trying to track down the right button anyway. Plus keeping it updated...


All times are GMT -6. The time now is 04:33 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI