Quantcast
Download
(5 Kb)
Download
Updated: 12/15/15 02:08 PM
Pictures
File Info
Compatibility:
Orsinium (2.2.4)
Updated:12/15/15 02:08 PM
Created:12/10/15 02:33 PM
Monthly downloads:229
Total downloads:3,086
Favorites:14
MD5:
libAddonKeybinds
Version: 2
by: merlight [More]
Stand-alone

This library splits the list of keybindings under Controls menu into Standard Keybinds and Addon Keybinds. It does that regardless of whether it is installed stand-alone or embedded in another add-on.


Library

The library hooks ZO_KeybindingsList's row setup and hide callbacks, and in these hooks fires custom callbacks via CALLBACK_MANAGER. The new callbacks are:

"libAddonKeybinds.SetupCategoryHeader" (rowControl, data)
"libAddonKeybinds.HideCategoryHeader" (rowControl, data)

"libAddonKeybinds.SetupKeybindRow" (rowControl, data)
"libAddonKeybinds.HideKeybindRow" (rowControl, data)

Example - adding custom setup/hide stuff to keybind Category header rows:
Lua Code:
  1. CALLBACK_MANAGER:RegisterCallback("libAddonKeybinds.SetupCategoryHeader",
  2.     function(rowControl, data)
  3.         df("setting up %q", data.categoryName)
  4.     end)
  5.  
  6. CALLBACK_MANAGER:RegisterCallback("libAddonKeybinds.HideCategoryHeader",
  7.     function(boundArg, rowControl, data)
  8.         df("%s %q", boundArg, data.categoryName)
  9.     end,
  10.     "hiding")
version 2
- replace colons in callback names with periods

version 1
- first release
Optional Files (0)


Archived Files (1)
File Name
Version
Size
Author
Date
1
5kB
merlight
12/10/15 02:33 PM


Post A Reply Comment Options
Unread 12/15/15, 02:34 PM  
merlight
AddOn Author - Click to view AddOns

Forum posts: 645
File comments: 208
Uploads: 12
Warning: in v2 I replaced colons in callback names with periods. Those colons might confuse someone into thinking that callbacks receive the library as the first argument, which is not the case. They're just string keys into a table. Lua is oblivious to what's in a name, for it isn't that envious.
Last edited by merlight : 12/15/15 at 02:34 PM.
Report comment to moderator  
Reply With Quote
Unread 12/10/15, 08:29 PM  
BigM
 
BigM's Avatar

Forum posts: 8
File comments: 245
Uploads: 0
Thanks see this being very useful.
Report comment to moderator  
Reply With Quote
Unread 12/10/15, 04:04 PM  
CaptainBlagbird
 
CaptainBlagbird's Avatar
AddOn Author - Click to view AddOns

Forum posts: 51
File comments: 122
Uploads: 22
really useful, thanks
__________________
My Addons: Quest Map, Helmet Toggle, Sieged Keeps, Target Whisper, ... | Also available on GitHub
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: