Differentiate minimap event marker shapes

This commit is contained in:
2026-06-20 04:34:01 +09:00
parent cb5cb26995
commit f42229930a
3 changed files with 70 additions and 3 deletions

View File

@@ -4769,9 +4769,7 @@ func _draw_minimap_event_markers() -> void:
if typeof(cell) != TYPE_VECTOR2I or not state.is_inside(cell):
continue
var marker_rect := _minimap_marker_rect(cell, 1.05, 4.8, 7.0)
draw_rect(marker_rect, Color(0.020, 0.014, 0.010, 0.84))
draw_rect(marker_rect.grow(-1.0), _minimap_event_marker_fill_color(kind))
draw_rect(marker_rect, _minimap_marker_outline_color(), false, 1.0)
_draw_minimap_event_marker_shape(marker_rect, kind)
func _minimap_marker_rect(cell: Vector2i, scale: float = 1.0, min_size: float = 4.0, max_size: float = 8.0) -> Rect2:
@@ -4793,6 +4791,62 @@ func _minimap_event_marker_fill_color(kind: String) -> Color:
return Color(color.r, color.g, color.b, 0.90)
func _minimap_event_marker_shape(kind: String) -> String:
var normalized_kind := kind.strip_edges().to_lower()
if normalized_kind == "supply":
return "circle"
if normalized_kind == "tactic":
return "triangle"
if normalized_kind == "gold":
return "diamond"
return "square"
func _draw_minimap_event_marker_shape(marker_rect: Rect2, kind: String) -> void:
var shape := _minimap_event_marker_shape(kind)
var fill := _minimap_event_marker_fill_color(kind)
var outline := _minimap_marker_outline_color()
var center := marker_rect.get_center()
var radius := marker_rect.size.x * 0.50
if shape == "circle":
draw_circle(center, radius * 1.08, outline)
draw_circle(center, radius * 0.72, fill)
elif shape == "triangle":
var points := PackedVector2Array([
Vector2(center.x, marker_rect.position.y),
Vector2(marker_rect.end.x, marker_rect.end.y),
Vector2(marker_rect.position.x, marker_rect.end.y)
])
var inner := PackedVector2Array([
Vector2(center.x, marker_rect.position.y + marker_rect.size.y * 0.22),
Vector2(marker_rect.end.x - marker_rect.size.x * 0.22, marker_rect.end.y - marker_rect.size.y * 0.16),
Vector2(marker_rect.position.x + marker_rect.size.x * 0.22, marker_rect.end.y - marker_rect.size.y * 0.16)
])
draw_colored_polygon(points, outline)
draw_colored_polygon(inner, fill)
draw_polyline(PackedVector2Array([points[0], points[1], points[2], points[0]]), outline, 0.7)
elif shape == "diamond":
var diamond := PackedVector2Array([
Vector2(center.x, marker_rect.position.y),
Vector2(marker_rect.end.x, center.y),
Vector2(center.x, marker_rect.end.y),
Vector2(marker_rect.position.x, center.y)
])
var inner_diamond := PackedVector2Array([
Vector2(center.x, marker_rect.position.y + marker_rect.size.y * 0.18),
Vector2(marker_rect.end.x - marker_rect.size.x * 0.18, center.y),
Vector2(center.x, marker_rect.end.y - marker_rect.size.y * 0.18),
Vector2(marker_rect.position.x + marker_rect.size.x * 0.18, center.y)
])
draw_colored_polygon(diamond, outline)
draw_colored_polygon(inner_diamond, fill)
draw_polyline(PackedVector2Array([diamond[0], diamond[1], diamond[2], diamond[3], diamond[0]]), outline, 0.7)
else:
draw_rect(marker_rect, Color(0.020, 0.014, 0.010, 0.84))
draw_rect(marker_rect.grow(-1.0), fill)
draw_rect(marker_rect, outline, false, 1.0)
func _minimap_marker_outline_color() -> Color:
return Color(UI_PARCHMENT_TEXT.r, UI_PARCHMENT_TEXT.g, UI_PARCHMENT_TEXT.b, 0.88)