Skip to content

Commit

Permalink
Variants are more different
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomTas3r authored Oct 15, 2024
1 parent 823f32e commit fa2e905
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions addons/block_code/ui/blocks/utilities/background/background.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -113,23 +115,23 @@ 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))

# 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))
Expand Down Expand Up @@ -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))

Expand All @@ -188,23 +192,23 @@ 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))

# 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:
Expand Down

0 comments on commit fa2e905

Please sign in to comment.