From fa2e905d60479155e2ab8ee0cbc1b775a6ba4d40 Mon Sep 17 00:00:00 2001 From: Daze Date: Tue, 15 Oct 2024 16:25:15 +0000 Subject: [PATCH] Variants are more different --- .../blocks/utilities/background/background.gd | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/addons/block_code/ui/blocks/utilities/background/background.gd b/addons/block_code/ui/blocks/utilities/background/background.gd index 9a045343..ca7ff414 100644 --- a/addons/block_code/ui/blocks/utilities/background/background.gd +++ b/addons/block_code/ui/blocks/utilities/background/background.gd @@ -87,14 +87,16 @@ func _draw(): # Right side if variant > 0: # Top - if variant == 3 or variant == 4 or variant == 7 or variant == 8: + if variant == 3 or variant == 4: fill_polygon.append(Vector2(size.x - 5.0, 0.0)) else: fill_polygon.append(Vector2(size.x, 0.0)) # Middle - if variant == 3 or variant == 4 or variant == 5 or variant == 6: + if variant == 3 or variant == 4: fill_polygon.append(Vector2(size.x, size.y / 2.0)) + elif variant == 5 or variant == 6: + fill_polygon.append(Vector2(size.x, size.y * 2.0 / 3.0)) elif variant == 7 or variant == 8: fill_polygon.append(Vector2(size.x, size.y / 3.0)) @@ -113,7 +115,7 @@ func _draw(): # Left side if variant > 0: # Bottom - if variant == 2 or variant == 4 or variant == 6: + if variant == 2 or variant == 4 or variant == 6 or variant == 8: fill_polygon.append(Vector2(0.0, size.y)) else: fill_polygon.append(Vector2(5.0, size.y)) @@ -121,15 +123,15 @@ func _draw(): # Middle if variant == 4: fill_polygon.append(Vector2(5.0, size.y / 2.0)) - elif variant == 3 or variant == 5 or variant == 6: + elif variant == 3: fill_polygon.append(Vector2(0.0, size.y / 2.0)) - elif variant == 7: - fill_polygon.append(Vector2(0.0, size.y / 3.0)) - elif variant == 8: + elif variant == 5 or variant == 8: fill_polygon.append(Vector2(0.0, size.y * 2 / 3.0)) + elif variant == 6 or variant == 7: + fill_polygon.append(Vector2(0.0, size.y / 3.0)) # Top - if variant == 2 or variant == 3 or variant == 6 or variant == 7 or variant == 8: + if variant == 2 or variant == 3 or variant == 6 or variant == 8: fill_polygon.append(Vector2(5.0, 0.0)) else: fill_polygon.append(Vector2(0.0, 0.0)) @@ -159,14 +161,16 @@ func _draw(): # Right line if variant > 0: # Top - if variant == 3 or variant == 4 or variant == 7 or variant == 8: + if variant == 3 or variant == 4: stroke_polygon.append(Vector2(size.x - 5.0, 0.0)) else: stroke_polygon.append(Vector2(size.x, 0.0)) # Middle - if variant == 3 or variant == 4 or variant == 5 or variant == 6: + if variant == 3 or variant == 4: stroke_polygon.append(Vector2(size.x, size.y / 2.0)) + elif variant == 5 or variant == 6: + stroke_polygon.append(Vector2(size.x, size.y * 2.0 / 3.0)) elif variant == 7 or variant == 8: stroke_polygon.append(Vector2(size.x, size.y / 3.0)) @@ -188,7 +192,7 @@ func _draw(): edge_polygon.append(Vector2(5.0 + outline_middle, 0.0)) # Top - if variant == 2 or variant == 3 or variant == 6 or variant == 7 or variant == 8: + if variant == 2 or variant == 3 or variant == 6 or variant == 8: edge_polygon.append(Vector2(5.0, 0.0)) else: edge_polygon.append(Vector2(0.0, 0.0)) @@ -196,15 +200,15 @@ func _draw(): # Middle if variant == 4: edge_polygon.append(Vector2(5.0, size.y / 2.0)) - elif variant == 3 or variant == 5 or variant == 6: + elif variant == 3: edge_polygon.append(Vector2(0.0, size.y / 2.0)) - elif variant == 7: - edge_polygon.append(Vector2(0.0, size.y / 3.0)) - elif variant == 8: + elif variant == 5 or variant == 8: edge_polygon.append(Vector2(0.0, size.y * 2.0 / 3.0)) + elif variant == 6 or variant == 7: + edge_polygon.append(Vector2(0.0, size.y / 3.0)) # Bottom - if variant == 2 or variant == 4 or variant == 6: + if variant == 2 or variant == 4 or variant == 6 or variant == 8: edge_polygon.append(Vector2(0.0, size.y)) edge_polygon.append(Vector2(5.0 + outline_middle, size.y)) else: