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

Add a location picker #21955

Merged
merged 17 commits into from Apr 24, 2018
Merged

Add a location picker #21955

merged 17 commits into from Apr 24, 2018

Conversation

balderdash
Copy link
Contributor

@balderdash balderdash commented Apr 19, 2018

picker2

Overview of the changes in this PR:

  • Add "custom inputs" to the block creator, which allow you to configure app-specific input types on top of the standard dropdown, value input, etc. In this case I'm using it to add a locationPicker input, which shows coordinates and a button to change them.
  • Add a simpleValue option to blocks, which makes them act as a simple wrapper around a single argument.
  • Implement the rest of the UI for location picker in GamelabVisualizationColumn, depending on actions and state from the LocationPickerModule.

@balderdash balderdash requested review from Hamms and epeach April 20, 2018 18:55
@@ -2320,6 +2320,7 @@ StudioApp.prototype.setStartBlocks_ = function (config, loadLastAttempt) {
this.loadBlocks(startBlocks);
} catch (e) {
if (loadLastAttempt) {
console.error(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: stray console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the problem is an undefined block, the mainBlockSpace.clear() call on the next line throws a less useful exception, so I want to expose this one.

Cleaned it up a little to actually re-throw this exception if the following lines run into a problem.

}) => {
if (!func === !expression) {
throw new Error('Provide either func or expression, but not both');
if (!!func + !!expression + !!simpleValue !== 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

clever!

@balderdash balderdash merged commit b70576d into staging Apr 24, 2018
@balderdash balderdash deleted the picker branch April 26, 2018 00:06
@balderdash balderdash mentioned this pull request May 14, 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