Quantcast
Download
(4 Kb)
Download
Updated: 09/06/19 04:28 PM
Pictures
File Info
Compatibility:
Scalebreaker (5.1.5)
Updated:09/06/19 04:28 PM
Created:12/10/15 02:33 PM
Monthly downloads:3,023
Total downloads:38,869
Favorites:58
MD5:
libAddonKeybinds  Popular! (More than 5000 hits)
Version: 3
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 3
- include AddOnVersion, IsLibrary fields in manifest
- avoid hard dependency on LibStub (not bundled anymore)

version 2
- replace colons in callback names with periods

version 1
- first release
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Uploader
Date
2
5kB
merlight
12/15/15 02:08 PM
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: 679
File comments: 213
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: 15
File comments: 369
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: 53
File comments: 171
Uploads: 23
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: