Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented hook.Exists and hook.Temporary function into the hook module #2092

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Jul 3, 2024

  1. Update hook.lua

    Implemented a simple hook.Exists function to check if a hook exists or not.
    
    Purpose:
    A cleaner way to check if a hook exists instead of having to do something ugly like ( hool.GetTable()[ "event" ][ "identifier" ] )
    The-Lord-of-Owls authored Jul 3, 2024
    Configuration menu
    Copy the full SHA
    d0c01a9 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. Update hook.lua

    Added hook..Temporary() function to hook module.
    
    Purpose: Provides a quick and simple way to create hooks that will remove themselves after a certain amount of times being ran.
    
    Args: string hook_event, any identifier, integer max_runs, function func
    
    Note: If only event_name, name and max_runs are provided, it will assume that the max_runs is the hook functions and that this hook should only be ran once before removing itself. This is a failsafe
    The-Lord-of-Owls authored Jul 8, 2024
    Configuration menu
    Copy the full SHA
    6dddee3 View commit details
    Browse the repository at this point in the history
  2. Update hook.lua

    Utilized the same logic as hook.Add and hook.Remove inside hook.Temporary to reduce overhead from double validating args
    The-Lord-of-Owls authored Jul 8, 2024
    Configuration menu
    Copy the full SHA
    cf62fa7 View commit details
    Browse the repository at this point in the history
  3. Update hook.lua

    The-Lord-of-Owls authored Jul 8, 2024
    Configuration menu
    Copy the full SHA
    5d009a9 View commit details
    Browse the repository at this point in the history