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

find broadcast senders and receivers from block context menu #2675

Merged
merged 2 commits into from Aug 7, 2020

Conversation

bromagosa
Copy link
Collaborator

Inspired by what Scratch 2.0 used to have, and of course by "senders / implementors" in The Language.

Copy link
Owner

@jmoenig jmoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally love this feature, Bernat! This is excellent and the code is fine, don't be bewildered by my many comments, just a bunch of things to discuss, not having strong opinions on any of them. Thanks!

src/blocks.js Outdated Show resolved Hide resolved
src/objects.js Outdated Show resolved Hide resolved
src/gui.js Outdated Show resolved Hide resolved
src/gui.js Show resolved Hide resolved
src/gui.js Show resolved Hide resolved
src/objects.js Outdated Show resolved Hide resolved
src/blocks.js Outdated Show resolved Hide resolved
src/blocks.js Outdated Show resolved Hide resolved
Copy link
Owner

@jmoenig jmoenig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes all look fine to me, thank you!

this.selector
)) {
menu.addLine();
menu.addItem(
(this.selector === 'receiveMessage' ?
(this.selector.indexOf('receive') === 0 ?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha! I guess we need to remember this naming convention now :-)

if (((this.selector === 'doSend') && inputs[1] instanceof InputSlotMorph)) {
receiverName = this.inputs()[1].evaluate();
} else if (this.selector.indexOf('receive') === 0) {
receiverName = this.scriptTarget().name;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever!

@jmoenig jmoenig merged commit 2a53ec6 into jmoenig:master Aug 7, 2020
@bromagosa bromagosa deleted the senders-receivers branch February 2, 2022 12:02
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.

None yet

2 participants