Skip to content
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

fix: improve reliability of block value reporting #77

Merged
merged 2 commits into from
May 16, 2024

Conversation

gonfunko
Copy link
Owner

This PR, in conjunction with gonfunko/scratch-gui#14, makes block value reporting work consistently for all report-able blocks. Previously, reporting blocks that were present for both the stage and sprites didn't report their values correctly. This seems to be because block recycling interfered with the VM's monitoring of the state of truth, which has been resolved by excluding reporting blocks (those with an output) from recycling.

Finding of fields for blocks when reporting is invoked has been made more reliable, vs just assuming that there would be one in the fieldrow of the first item in a block's inputList.

Finally, this PR disables the normal toolbox refresh method, since Scratch manually manages toolbox refreshes for performance reasons. An additional method to force a refresh has been added for use by scratch-gui.

@gonfunko gonfunko merged commit cb5b068 into modern-blockly May 16, 2024
1 check passed
@gonfunko gonfunko deleted the reporters branch May 16, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants