Files
idle/core/prestige/prestige_buff_connection_overlay.gd
Michele Rossi 81a4058b04 systems rework: buffs, prestige graph, research, modular architecture
Decouples core systems from centralized globals in favor of catalogue-based architecture and data-driven content.

   Key changes:
   - Prestige: node-based buff tech tree, graph panel, progress bar
   - Research: multi-worker system, per-generator research, xp generation
   - Ascension: meta-currency layer via multi-currency prestige resets
   - Buffs: refactored as generator-independent via catalogues
   - UI: currency panel, edge-scrolling camera + zoom, current-goal panel
   - Alchemy Tower: crafting building with recipe/cost system
   - Testing: 7 test suites (ascension, prestige, research, goals)
   - Content: migrated from hardcoded idles/ to gym format (tiny_sword)
2026-05-07 20:36:21 +00:00

44 lines
1.4 KiB
GDScript

## Draws bezier curves between connected PrestigeBuffGraphTile nodes in the graph panel.
## Store pairs of tile references before calling queue_redraw().
class_name PrestigeBuffConnectionOverlay
extends Control
## Pairs of [parent_tile, child_tile] to connect.
var _connections: Array = []
func _ready() -> void:
mouse_filter = Control.MOUSE_FILTER_IGNORE
## Replace all connections and redraw.
func set_connections(connections: Array) -> void:
_connections = connections
queue_redraw()
func _draw() -> void:
if _connections.is_empty():
return
for pair in _connections:
var parent_tile: Control = pair[0] as Control
var child_tile: Control = pair[1] as Control
if parent_tile == null or child_tile == null:
continue
var from_pos: Vector2 = _tile_bottom_center(parent_tile)
var to_pos: Vector2 = _tile_top_center(child_tile)
draw_line(from_pos, to_pos, Color(0.6, 0.6, 0.7, 0.6), 2.0)
func _tile_bottom_center(tile: Control) -> Vector2:
var rect: Rect2 = tile.get_global_rect()
var global_pos: Vector2 = Vector2(rect.position.x + rect.size.x * 0.5, rect.position.y + rect.size.y)
return get_global_transform().affine_inverse() * global_pos
func _tile_top_center(tile: Control) -> Vector2:
var rect: Rect2 = tile.get_global_rect()
var global_pos: Vector2 = Vector2(rect.position.x + rect.size.x * 0.5, rect.position.y)
return get_global_transform().affine_inverse() * global_pos