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

Behavior editor #22307

Merged
merged 12 commits into from May 18, 2018
Merged

Behavior editor #22307

merged 12 commits into from May 18, 2018

Conversation

balderdash
Copy link
Contributor

@balderdash balderdash commented May 10, 2018

This adds a "Behavior"-typed toolbox category that includes all the behaviors defined in your program, complete with "Create a Behavior" button:
image

You also get a modal behavior editor when you create/edit a behavior. For now you just get one param named this sprite:
image

@balderdash balderdash changed the base branch from categorized-variables to staging May 10, 2018 22:14
@balderdash
Copy link
Contributor Author

func: behavior,
extraArgs: [],
};
behavior = createBehavior(behavior, []);
Copy link
Contributor

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

Copy link
Contributor Author

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,
});
Copy link
Contributor

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)

Copy link
Contributor Author

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.

Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

This looks great!

@balderdash balderdash merged commit 35807fb into staging May 18, 2018
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