- Notifications
You must be signed in to change notification settings - Fork28
Add Get Property from Node expression block#34
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
I did start to rebase this, but it looks like there's an unrelated issue in main blocking me from testing it (and fixing my examples), so I'll leave this with the conflicts for now. I did realize that a |
1b1415e
to8dfa35c
CompareThere 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 good to me. I left a comment for the Variant type and suggestions.
Ideally learners should not have to enter property names or node names by text. I remember plugins opening a node selector. Maybe we should do that for blocks with a node parameter. It seems thatPROPERTY_HINT_NODE_TYPE
can be useful. The alternative is to traverse the tree and create blocks like "This object".
@@ -83,6 +83,11 @@ static func get_general_categories() -> Array[BlockCategory]: | |||
b.statement = "print({text})" | |||
test_list.append(b) | |||
b = BLOCKS["statement_block"].instantiate() | |||
b.block_format = "print value {value: VARIANT}" |
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.
What about not passing a type at all when type is not needed? Something like"print value {value}"
is assumed to have no type. So this can match#43 better.
Ultimately I think we should get rid ofserialized_props
and stop converting back and forth from enum types to strings. And have resources for every block, with parameters as exported properties.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
A property is always returned as a variant, which must be cast to aconcrete type by using a type casting block.
Co-authored-by: manuq <manuel.por.aca@gmail.com>
6c2ef3a
to7f9a689
Compare
Uh oh!
There was an error while loading.Please reload this page.
https://phabricator.endlessm.com/T35497