You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed mechanism, component, and event blocks to use functions mrcOnMove 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.
0 commit comments