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
Behavior editor #22307
Behavior editor #22307
Conversation
4bdb3a7
to
ac136cb
Compare
efba007
to
2f67295
Compare
func: behavior, | ||
extraArgs: [], | ||
}; | ||
behavior = createBehavior(behavior, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the purpose of this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I meant to use this function in the behavior getter block, I haven't added support for parameterized behaviors to these blocks yet, so this isn't needed.
Reverted for now.
} | ||
}, | ||
addDefaultVar: false, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love how much manual work is required here to get this to work, particularly given how much of it is just copying stuff from procedures_defnoreturn
. Can some of this be pushed into Blockly and generalized? (possibly in a separate PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a helper in code-dot-org/blockly#107 and used it in 1a2037d, cutting out quite a lot of the extra junk here.
This reverts commit dbb6553d2f4d69ba46fcc61464711fd23689f936.
5bdfc9d
to
cd54708
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
This adds a "Behavior"-typed toolbox category that includes all the behaviors defined in your program, complete with "Create a Behavior" button:
You also get a modal behavior editor when you create/edit a behavior. For now you just get one param named
this sprite
: