Enable unit selection and path visualization logic via Cursor interactions.

This commit is contained in:
gdz
2025-12-26 23:11:33 +01:00
parent c4b2d6ff94
commit 2f82eb80e4
5 changed files with 42 additions and 65 deletions

View File

@@ -47,7 +47,7 @@ func _ready() -> void:
# Pathing and Grid
set_process(false)
_pathFollow.rotates = false
#_pathFollow.rotates = false
cell = grid.calculateGridCoordinates(position)
position = grid.calculateMapPosition(cell)
@@ -55,7 +55,8 @@ func _ready() -> void:
# We create the curve resource here because creating it in the editor prevents
# us from moving the unit.
if not Engine.is_editor_hint():
_path.curve = Curve2D.new()
pass
#_path.curve = Curve2D.new()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:

View File

@@ -655,9 +655,7 @@ texture = ExtResource("5_ulevp")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("RectangleShape2D_15sed")
[node name="Path2D" type="Path2D" parent="."]
[node name="PathFollow2D" type="PathFollow2D" parent="Path2D"]
[node name="PathPrev" type="Line2D" parent="."]
[connection signal="mouse_entered" from="Area2D" to="." method="_markUnit"]
[connection signal="mouse_exited" from="Area2D" to="." method="_unMarkUnit"]