Skip to content

A Garry's Mod script that allows developers to use the PlayerBindPress hook without breaking other addons.

License

Notifications You must be signed in to change notification settings

DyaMetR/unintrusive-bind-press

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Unintrusive bind press

A solution to breaking other addons using the mouse wheel

How to install

Place the script file inside a Lua environment folder (such as the lua folder or a game mode folder).

Then, include the file client-side wise as the PlayerBindPress hook is client-side only. In case of manual inclusion, make sure your implementation is included after you've included this script.

Alternatively, you can place it into lua/autorun/client for it to be included automatically.

How to use

UnintrusiveBindPress.add(id, func, priority)

Hooks a function to the PlayerBindPress event.

  • id: unique function identifier.
  • func: function to run.
  • priority (optional): sets a priority (1 being top priority)

Other functions

UnintrusiveBindPress.remove(id)

Removes a function hooked to the PlayerBindPress event.

  • id: unique function identifier.

UnintrusiveBindPress.getTable(priority)

Returns the list of functions hooked to the PlayerBindPress via this system.

  • priority (optional): the priority of the functions we want to get.

About

A Garry's Mod script that allows developers to use the PlayerBindPress hook without breaking other addons.

Topics

Resources

License

Stars

Watchers

Forks

Languages