-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor addEvent() to forward events rather than take callbacks
Instead of addEvent creating the event on the zone and calling a callback when the event is triggered and the player is in the zone, it instead creates a middleman event that forwards the arguments from the event trigger to the real event if the player is in the zone. So you would call addEvent("test") and that would create an internal event that would call the "test" event if the player was in the zone when the event was triggered. That way, you can just add an event handler anywhere in the code to catch that "test" event.
- Loading branch information
Showing
2 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters