Skip to content

Commit

Permalink
Add outline to decoration peering bits to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Portponky committed Mar 26, 2024
1 parent 0bfb516 commit 814fbd0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions addons/better-terrain/editor/TileView.gd
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,11 @@ func _draw_tile_data(texture: Texture2D, rect: Rect2, src_rect: Rect2, td: TileD
return

var transform := Transform2D(0.0, rect.size, 0.0, rect.position)
var center_polygon = BetterTerrain.data.peering_polygon(tileset, terrain.type, -1)
draw_colored_polygon(transform * center_polygon, Color(terrain.color, 0.6))
var center_polygon = transform * BetterTerrain.data.peering_polygon(tileset, terrain.type, -1)
draw_colored_polygon(center_polygon, Color(terrain.color, 0.6))
if terrain.type == BetterTerrain.TerrainType.DECORATION:
center_polygon.append(center_polygon[0])
draw_polyline(center_polygon, Color.BLACK)

if paint < BetterTerrain.TileCategory.EMPTY or paint >= BetterTerrain.terrain_count(tileset):
return
Expand All @@ -392,8 +395,11 @@ func _draw_tile_data(texture: Texture2D, rect: Rect2, src_rect: Rect2, td: TileD
var paint_terrain := BetterTerrain.get_terrain(tileset, paint)
for p in BetterTerrain.data.get_terrain_peering_cells(tileset, terrain.type):
if paint in BetterTerrain.tile_peering_types(td, p):
var side_polygon = BetterTerrain.data.peering_polygon(tileset, terrain.type, p)
draw_colored_polygon(transform * side_polygon, Color(paint_terrain.color, 0.6))
var side_polygon = transform * BetterTerrain.data.peering_polygon(tileset, terrain.type, p)
draw_colored_polygon(side_polygon, Color(paint_terrain.color, 0.6))
if paint_terrain.type == BetterTerrain.TerrainType.DECORATION:
side_polygon.append(side_polygon[0])
draw_polyline(side_polygon, Color.BLACK)


func _draw_tile_symmetry(texture: Texture2D, rect: Rect2, src_rect: Rect2, td: TileData, draw_icon: bool = true) -> void:
Expand Down

0 comments on commit 814fbd0

Please sign in to comment.