-
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
Entry restyle and hexagonal booleans #273
Conversation
Adds 8 new shapes for the background used in blocks, the bottom tab can be hidden and is shown by default, makes outlines optional and are shown by default
Hi @DoomTas3r. Although nice, adding variants to the blocks shape is not fixing or improving anything per se, so unlikely to be merged. But here is a proposal to improve the entry blocks and your help would be very appreciated! #278 Can you retarget this PR to make that improvement? |
@DoomTas3r this is another issue that you can help with related to block shapes: #279 |
@manuq I think this should be good. You can tell me if any errors related to this are found. The other types can also be styled but I was hesitant because confusion can be caused from overloading |
@DoomTas3r whoa!! What you managed to do regarding shapes is amazing, thanks! I'll review the code in a bit. |
I like hexagons!
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.
@DoomTas3r I've been delaying this review so much, sorry! Here are a few changes requested. It works like a charm.
_panel_normal.border_color = color.darkened(0.2) | ||
if not definition == null and definition.variant_type == Variant.Type.TYPE_BOOL: | ||
_background.visible = true | ||
_background.variant = 3 |
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.
Please use enumerators rather than integers. For example:
enum BackgroundVariant { ROUND, POINTY, ... }
@export var top_variant: int = 0: | ||
set = _set_top_variant | ||
|
||
## |0|, \1/, /2/, <3>, >4>, v5v, v6^, \7y, /8y |
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.
We really don't need the 9 shapes that the first commit adds, and they make the code very hard to read. We only need:
- A pointy background for value blocks of variant type BOOLEAN.
- A round ellipse for entry blocks.
if variant > 0: | ||
# Top | ||
if variant == 3 or variant == 4: | ||
fill_polygon.append(Vector2(size.x - 5.0, 0.0)) |
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.
These 5.0
are hardcoded everywhere. Please add a new "pointy width" constant:
fill_polygon.append(Vector2(size.x - 5.0, 0.0)) | |
fill_polygon.append(Vector2(size.x - Constants.POINTY_WIDTH, 0.0)) |
@manuq Okay, the code was cleaned up. I thought maybe the Vector2 casting would be confusing, but I checked this block configuration |
@DoomTas3r thanks! The PR diff is much clear now. Now you can see that the last commit reverts things added in the previous ones. The next level in contribution is to do an interactive rebase of your work using
For the sake of merging this soon, I'll do the interactive rebase myself this time. |
I made a refactor of the current shapes to make this easier to implement #323 |
A cleaned up version of this has been merged #325 Thanks so much for your contribution, @DoomTas3r ! |
Adds a new top knob variant and a new background variant. Bottom tabs and outlines can now be hidden. Booleans are now hexagonal by default
Targeting #278 and #279