Skip to content

Text validation #160

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

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Text validation #160

merged 4 commits into from
Jul 26, 2024

Conversation

manuq
Copy link
Contributor

@manuq manuq commented Jul 24, 2024

Add validation for the input text, and default values for blocks. Goal is to prevent generated code with syntax errors. It also improves the UX.

https://phabricator.endlessm.com/T35562

manuq added 4 commits July 24, 2024 10:46
For float, int, and Vector2 types. If the text is not valid, reset to
the last submitted text and don't emit the midified signal.
We are not exposing PI or TAU constants. It's simpler to have a
single way to set/change rotation as degrees.

The Godot UI also has a degrees slider for Node2D rotation.

rotation_degrees is a property, so remove the custom setter.
All possible blocks gain default values. So they can be used directly
without having to type a value. And most importantly, so the script is
not generated with syntax errors.

The defaults are opinionated, they have to be. Eg. set scale to double
size, change position so the node2d moves to the right-bottom.

Also: remove "change by" block for modulate and visible properties. They
don't make sense.

https://phabricator.endlessm.com/T35562
@manuq manuq force-pushed the text-validation branch from 98b97a0 to ce6f0a1 Compare July 24, 2024 16:06
@manuq
Copy link
Contributor Author

manuq commented Jul 24, 2024

The tests encountered a bug. This is now ready for review again.

Copy link
Contributor

@dylanmccall dylanmccall left a comment

Choose a reason for hiding this comment

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

No complaints from me! It's great to have this :)

@manuq manuq merged commit ae97597 into main Jul 26, 2024
2 checks passed
@manuq manuq deleted the text-validation branch July 26, 2024 12:41
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