NodeEvent, MenuItemActivatedEvent#1964
Open
Alphalaneous wants to merge 7 commits intogeode-sdk:mainfrom
Open
Conversation
dankmeme01
reviewed
Mar 30, 2026
Member
dankmeme01
left a comment
There was a problem hiding this comment.
this is hacky and i love it!
most of the PR looks fine to me, but there is one concern i have with ObjectDestroyedEvent. does this end up running on every CCObject ever created (and destroyed)? because there are multiple potential issues with this:
- thread safety - it is common for things like CCImage, CCTexture2D, etc. to be created in a thread. if this event fires for those, that would likely cause UB in the current implementation, as you are not using
ThreadSafeGlobalEvent - performance hit - going through the event machinery on every destroyed
CCObjectsounds like it can have real performance implications, and this will especially be worse if thread-safe events are used. would need to benchmark it by creating & deleting a huge amount of objects and comparing the time taken with & without the event being sent
Maybe can be revisited in the future
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses the Cocos Script Engine system to add new events for CCNodes and CCMenuItems. Since Geometry Dash never sets these up itself, we can make our own and use them for useful events. None of these require hooks.
NodeEvent
OnEnter,OnExit,OnEnterTransitionDidFinish,OnExitTransitionDidStart, andOnCleanup, which match their corresponding methods.MenuItemActivatedEvent
If this PR is merged and a Geode Update is prepared, it will need to be synchronized with an Alpha's Geode Utils update, or else things will break.