Library hook

Deals with hooks

Functions

add( hookName, name, func ) Registers a hook callback.
remove( hookName, name ) Remove a hook
run( hookName, ... ) Run a hook


Functions

hook.add( hookName, name, func )
Registers a hook callback.

Environment:

Shared

Parameters:

  • hookName: The hook name.
  • name: A unique identifier for this callback.
  • func: A callback function to run for this hook.

Usage:

    hook.add( "input", "DetectWireInputs", function( Input, Value ) 
    	-- Do stuff here... 
    end )
hook.remove( hookName, name )
Remove a hook

Environment:

Shared

Parameters:

  • hookName: The hook name.
  • name: The unique name for this hook.

Usage:

    hook.remove( "input", "DetectWireInputs" )
hook.run( hookName, ... )
Run a hook

Environment:

Shared

Parameters:

  • hookName: The hook name.
  • ...: Arguments to pass to listeners.

Usage:

    local Result = hook.run( "myevent", "Some", "arguments", "yay", 1, 2, 3 )

Valid XHTML 1.0!