Soften battlefield grid and guard text visibility

This commit is contained in:
2026-06-20 09:53:52 +09:00
parent 91aa912c61
commit 21246c602f
2 changed files with 114 additions and 16 deletions

View File

@@ -5735,20 +5735,20 @@ func _texture_cover_region_source_rect(texture: Texture2D, visible_rect: Rect2,
func _terrain_fill_color(cell: Vector2i, terrain_key: String, has_background: bool) -> Color:
var color := state.get_terrain_color(cell)
var alpha := 0.105 if has_background else 0.34
var alpha := 0.056 if has_background else 0.34
if terrain_key == "W":
alpha += 0.025
alpha += 0.018
elif terrain_key == "C" or terrain_key == "H" or terrain_key == "T":
alpha += 0.015
alpha += 0.010
elif terrain_key == "D":
alpha += 0.012
alpha += 0.008
color.a = alpha
return color
func _map_grid_color(has_background: bool) -> Color:
var color := GRID_COLOR
color.a = 0.012 if has_background else 0.28
color.a = 0.006 if has_background else 0.22
return color
@@ -5845,13 +5845,13 @@ func _draw_terrain_feature(feature_key: String, rect: Rect2, modulate: Color = C
func _draw_tactical_tile_overlay(marker_key: String, rect: Rect2, fill_color: Color, border_color: Color, marker_alpha: float, fill_alpha_scale: float = 0.48, inset: float = 5.0) -> void:
var fill := fill_color
fill.a *= fill_alpha_scale
fill.a *= fill_alpha_scale * 0.58
if fill.a > 0.0:
draw_rect(rect.grow(-inset), fill)
_draw_tile_marker(marker_key, rect, Color(1.0, 1.0, 1.0, marker_alpha), 0.0)
_draw_tile_marker(marker_key, rect, Color(1.0, 1.0, 1.0, marker_alpha * 1.12), 0.0)
var line := border_color
line.a = minf(line.a, 0.68)
_draw_tactical_corner_brackets(rect.grow(-(inset + 2.0)), line, 8.0, 1.35)
line.a = minf(line.a * 0.78, 0.48)
_draw_tactical_corner_brackets(rect.grow(-(inset + 2.0)), line, 7.0, 1.15)
func _draw_tactical_corner_brackets(rect: Rect2, color: Color, length: float = 8.0, width: float = 1.35) -> void:
@@ -5873,15 +5873,15 @@ func _draw_tactical_corner_brackets(rect: Rect2, color: Color, length: float = 8
func _terrain_texture_modulate(cell: Vector2i, terrain_key: String, has_background: bool) -> Color:
var alpha := 0.26 if has_background else 0.58
var alpha := 0.20 if has_background else 0.58
if terrain_key == "W":
alpha += 0.07 if has_background else 0.10
alpha += 0.06 if has_background else 0.10
elif terrain_key == "C" or terrain_key == "T":
alpha += 0.08 if has_background else 0.12
alpha += 0.07 if has_background else 0.12
elif terrain_key == "R":
alpha += 0.05 if has_background else 0.08
alpha += 0.04 if has_background else 0.08
elif terrain_key == "F" or terrain_key == "H" or terrain_key == "D":
alpha += 0.03 if has_background else 0.06
alpha += 0.025 if has_background else 0.06
alpha *= 0.94 + _cell_noise(cell, 137) * 0.12
return Color(1.0, 1.0, 1.0, clampf(alpha, 0.0, 0.82))