Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Oct 5, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…Move for handling events from blockly (#272)

* Rename mrcValidate to mrcOnModuleCurrent because it is called when the module becomes the current module.

* Added code to mrc_component.ts and mrc_mechanism.ts to add a warning if the block is not in the holder. Updated code in mrc_event.ts (which already existed) to be similar.

* Added reason parameter to mrcOnLoad methods.

In mrc_mechanism_component_holder.ts:
Removed code that uses change framework.
Replaced function setName with method MechanismComponentHolderBlock.setNameOfChildBlock.
Replaced function updateToolboxAfterDelay with method MechanismComponentHolderBlock.updateToolboxAfterDelay.
Added function mrcDescenantsMayHaveChanged, which calls method MechanismComponentHolderBlock.mrcDescenantsMayHaveChanged.
MechanismComponentHolderBlock.mrcDescenantsMayHaveChanged collects the ids of mechanisms, components, private components, and events and if they have changed, calls updateToolboxAfterDelay.

Updated mrc_mechanism, mrc_component, and mrc_event to call MechanismComponentHolderBlock.setNameOfChildBlock when they are connected to the holder.

Update mrc_mechanism, mrc_component, and mrc_event to call mrcDescendantsMayHaveChanged when they are moved.

* Removed unplug call on mechanism, component, or event blocks if they aren't in
the holder. If there are more than one of these in a stack and the user drags
the whole stack out of the holder, the unplug will unplug the top one from the
stack which is alarming.

In mrc_mechanism_component_holder:
Changed mrcMechanismIds to mrcMechanismBlockIds,
mrcComponentIds to mrcComponentBlockIds,
mrcPrivateComponentIds to mrcPrivateComponentBlockIds, and
mrcEventIds to mrcEventBlockIds.
Made them strings, which makes the comparing much more simple.
Added mrcOnDescendantDisconnected, which is called when a mechanism, component,
or event block is deleted.

In editor, added code to handle move event for disconnect and call
mrcOnDescendantDisconnect on the root block that the block was disconnected
from.
@pull pull bot locked and limited conversation to collaborators Oct 5, 2025
@pull pull bot added the ⤵️ pull label Oct 5, 2025
@pull pull bot merged commit 06b177f into alan412:main Oct 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant