Grid finally working and understood

This commit is contained in:
Aaron Wuthenow
2025-12-25 22:51:23 +01:00
parent 6e1a9eff35
commit f9ecb49658
21 changed files with 354 additions and 32 deletions

View File

@@ -7,7 +7,7 @@
[ext_resource type="Script" uid="uid://dukn3yshfepum" path="res://Scenes/Main/grid_debug.gd" id="5_y3v7k"]
[ext_resource type="PackedScene" uid="uid://b1d6lktijxy3s" path="res://Scenes/Unit/move/unit.tscn" id="6_2a143"]
[ext_resource type="Script" uid="uid://cidjtc27oj1gn" path="res://Scenes/Main/cursor.gd" id="7_y3v7k"]
[ext_resource type="Texture2D" uid="uid://bckknh8k5fh1s" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tiles/tile_0448.png" id="8_hryqi"]
[ext_resource type="Script" uid="uid://dtme43jtijpok" path="res://Scenes/Main/grid_display.gd" id="8_y3v7k"]
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_y3v7k"]
@@ -26,10 +26,12 @@ script = ExtResource("5_y3v7k")
grid = ExtResource("5_p6jpk")
[node name="Unit" parent="GameBoard" instance=ExtResource("6_2a143")]
visible = false
position = Vector2(400, 224)
grid = ExtResource("5_p6jpk")
[node name="Sprite2D" parent="GameBoard/Unit/PathFollow2D" index="1"]
texture = null
[node name="Cursor" type="Node2D" parent="GameBoard"]
position = Vector2(8, 8)
script = ExtResource("7_y3v7k")
@@ -37,7 +39,6 @@ grid = ExtResource("5_p6jpk")
[node name="Sprite2D" type="Sprite2D" parent="GameBoard/Cursor"]
position = Vector2(10, -10)
texture = ExtResource("8_hryqi")
[node name="Timer" type="Timer" parent="GameBoard/Cursor"]
wait_time = 0.1
@@ -46,3 +47,30 @@ wait_time = 0.1
position = Vector2(50, 50)
scale = Vector2(2, 2)
texture = SubResource("PlaceholderTexture2D_y3v7k")
[node name="HUD" type="CanvasLayer" parent="."]
[node name="GridDisplay" type="Control" parent="HUD"]
unique_name_in_owner = true
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("8_y3v7k")
[node name="MarginContainer" type="MarginContainer" parent="HUD/GridDisplay"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="PanelContainer" type="PanelContainer" parent="HUD/GridDisplay/MarginContainer"]
layout_mode = 2
[node name="ShowGrid" type="CheckBox" parent="HUD/GridDisplay/MarginContainer/PanelContainer"]
layout_mode = 2
text = "Show Grid"
[connection signal="accept_pressed" from="GameBoard/Cursor" to="." method="get_cell_information"]
[connection signal="toggled" from="HUD/GridDisplay/MarginContainer/PanelContainer/ShowGrid" to="HUD/GridDisplay" method="toggle_grid_display"]
[editable path="GameBoard/Unit"]