Hook system improvements
+ Allow assigning multiple hook types to a class. + Add hook types, that are executed (almost) on every occasion.
This commit is contained in:
parent
d4b2efe048
commit
e66ed05ef7
2 changed files with 23 additions and 23 deletions
|
@ -11,8 +11,9 @@ hook = hook_system.hook
|
|||
class Login:
|
||||
# Different hook types are executed at different places.
|
||||
# In this case, the hook is executed when a user logs in.
|
||||
#
|
||||
# Check the documentation for more hook types.
|
||||
hook_type = "player_login"
|
||||
hook_type = ["player_login"]
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
def __call__(self, hook_type, *args, **kwargs):
|
||||
print("LOGIN HOOK:", args, kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue