Let the user add event handlers to an opmode, for events defined in the robot #175
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.
In common_storage.ts, save the events declared in the module.
In mrc_event_handler.ts:
Refactored hardcoded fields names into constants FIELD_SENDER and FIELD_EVENT_NAME.
Added otherBlockId to EventHandlerExtraState and mrcOtherBlockId to EventHandlerMixin.
Added onLoad method that updates event handler blocks if the event definition has been changed.
Added functions addRobotEventHandlerBlocks and createRobotEventHandlerBlock to create blocks for the toolbox.
In editor.ts, added method getEventsFromRobot.
In hardware_category.ts, added function getRobotEventsBlocks and call it in getHardwareCategory when the current module is an opmode.