-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
EventCallback Improvements, Oops is now called Event #4395
EventCallback Improvements, Oops is now called Event #4395
Conversation
I have added a Global variable with the above name, for backwards compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cool for me, I would like to wait for @ranisalt opinion on this as well
Pull Request Prelude
Changes Proposed
Finally a better name for this system, or rather, this should have always been the name, since we're really dealing with
Events
, andEvents
are already callbacks.Here the optimization of PR #4237 is maintained, which by the way the idea of maintaining a local was horrible hahahaha
A new global table (
hasEvent
) was added that functions as a proxy with a metatable with the metamethod __index to check if the events exist, thus maintaining the logic of not creating global IDs for each event.The Events are now created from making a call to
Event
these objects can still be reused as before with the global
EventCallback
tableThere is no compatibility with the older EventCallback, yes or yes you have to rename Event and call it to get the object.
Whoever wants to make the changes here is an example:
Notes:
EventCallbacknow feel more natural and consistent with Revscript.Issues addressed: Nothing!