Thread Tools Display Modes
10-18-16, 02:01 PM   #1
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
SetBindingSpell() for mounts?

I'm updating an old addon that deals with keybinds, it used to use SetBindingSpell to bind mounts to keys, but it doesn't seem to work any more.

I'm running:
SetBindingSpell('I','Albino Drake')
which returns true, then

SaveBindings(2)
print(GetBindingAction('I'))
which returns
SPELL Albino Drake

But pressing 'I' does nothing (other spells work fine).

Is there some new function for doing this that I haven't found yet? I spotted C_MountJournal.SummonByID() which works fine, but can't see any way to pass it in a key to bind to.

Last edited by kraftman : 10-18-16 at 02:07 PM.
  Reply With Quote
10-18-16, 05:19 PM   #2
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Create a button, set the OnClick script handler to run C_MountJournal.SummonByID(), then use SetBindingClick to that button.

Some examples: https://github.com/p3lim-wow/Inomena...r/bindings.lua (eject, reload and hearthstone)
  Reply With Quote
10-19-16, 03:42 AM   #3
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
Is there no longer a way to do it directly then? Using buttons directly would then mean my addon is a requirement for the bindings to work, rather than an optional way to edit them
  Reply With Quote
10-19-16, 03:56 PM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
You could do it with SetBindingMacro, that one requires either a macro name or index (don't use index as it will change), and macros are shared across installations.
It does however require you to make the macro first.

Code:
CreateMacro('mountmacro', 'ability_backstab', '/run C_MountJournal.SummonByID(123)', true)
SetBindingMacro('I', 'mountmacro')
  Reply With Quote
10-20-16, 02:17 PM   #5
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
That's a great shout, cheers!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » SetBindingSpell() for mounts?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off