-
Notifications
You must be signed in to change notification settings - Fork 25
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
UI: Improve block shapes #325
Conversation
64fe001
to
609d19e
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.
Thanks arrange this improvement. It makes more like logic flowchart!
However, I notice a bug and place suggestion.
|
||
func _on_definition_changed(): | ||
super() | ||
_update_block_shape() |
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.
The _background accessed in _update_block_shape()
is only available when the node has been ready. However, seems like _on_definition_changed()
will be invoked by some where before this node becomes ready and shows error:
res://addons/block_code/ui/blocks/parameter_block/parameter_block.gd:29 - Invalid assignment of property or key 'is_pointy_value' with value of type 'bool' on a base object of type 'Nil'.
I think that here should add a if condition checking is_node_ready() before _update_block_shape()
.
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.
Good catch @starnight ! I appended a fixup commit. Adding await ready
did the trick.
To make entry blocks more distinguishable from the parameter blocks. Add another drag area, a rectangle that approximates the added ellipsis part. So the block can also be dragged from it. This drag area has a fixed size and doesn't expand. #278
Previously the parameter block and parameter input had a Panel node. Unlike the other blocks which had a custom shape, provided by the background control. But in the next commit we want to have different shapes for value blocks. So remove the panels and add background control nodes intead.
Mainly to test the background in isolation in a new Control scene.
Use a custom background drawing for parameter blocks and input that are of type boolean. #279
Previously all blocks had a statement shape as drag preview. Now that we have a good mapping of blocks / shapes, use the corresponding shape. A especial case is the control block which uses the background twice, one for the top part and one for the bottom part. For simplicity, use the statement shape in this case. Also, move drag colors to constants.
Contribution from @DoomTas3r #273 so I marked the 2 relevant commits as authored by them, although I changed things aggressively. In particular:
Since I was there I also fixed the drag preview which was showing the statement block shape for all blocks. It now looks like this:
Grabación de pantalla desde 2024-12-04 17-54-01.webm
Note that sometimes the parameter block won't resize when inner blocks are moved out. But this is not a problem introduced by this PR. It happens in main too:
Grabación de pantalla desde 2024-12-04 18-01-14.webm
Fix #278
Fix #279