From 8e2c90575c5cc8c97c9767b11536caa3e0c94e12 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Sat, 8 Mar 2025 16:04:49 -0500 Subject: [PATCH 1/2] Adding position to Waila for easier reference --- scenes/ui/waila.gd | 2 ++ scenes/ui/waila.tscn | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/scenes/ui/waila.gd b/scenes/ui/waila.gd index 20fb1d7..fbd8558 100644 --- a/scenes/ui/waila.gd +++ b/scenes/ui/waila.gd @@ -16,6 +16,7 @@ func _init() -> void: @onready var name_label: Label = $PanelContainer/MarginContainer/VBoxContainer/Name @onready var description_label: Label = $PanelContainer/MarginContainer/VBoxContainer/Description +@onready var position_label: Label = $PanelContainer/MarginContainer/VBoxContainer/Position var _target: Block @@ -33,6 +34,7 @@ func hook_target(id: String) -> void: var item: ItemResource = DBItems.ref.data[id] name_label.text = item.name + " (" + id + ")" description_label.text = item.description + position_label.text = str(_target.position) visible = true diff --git a/scenes/ui/waila.tscn b/scenes/ui/waila.tscn index d2484c4..4f16300 100644 --- a/scenes/ui/waila.tscn +++ b/scenes/ui/waila.tscn @@ -40,3 +40,8 @@ horizontal_alignment = 1 layout_mode = 2 text = "Entity Description (longer than name usually)" horizontal_alignment = 1 + +[node name="Position" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "(0, 0, 0)" +horizontal_alignment = 1 From c841dc68a8a9ca062e5e5141056ea1440d70d192 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Sat, 8 Mar 2025 16:05:09 -0500 Subject: [PATCH 2/2] Correcting type hint warning --- scenes/world/world.gd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scenes/world/world.gd b/scenes/world/world.gd index 0a8c567..c93183b 100644 --- a/scenes/world/world.gd +++ b/scenes/world/world.gd @@ -29,14 +29,13 @@ func _create_dropped_block(id: String, block_position: Vector3) -> void: func _create_test_blocks() -> void: var test_blocks: Array = ["001", "002", "003", "004"] - for index in range(0, test_blocks.size()): + for index: int in range(0, test_blocks.size()): _create_block("00" + str(index + 1), Vector3(index, 1, -3)) _create_block("00" + str(index + 1), Vector3(index, 2, -4)) _create_block("00" + str(index + 1), Vector3(index, 3, -5)) _create_dropped_block("00" + str(index + 1), Vector3(index, 2, -3)) - func _initialize_ground() -> void: for x: int in range(-10, 11): for z: int in range(-10, 11):