Browse Source

Merge pull request 'Feature: Add target position to waila' (#1) from waila-position into master

pull/2/head
Ryan Reed 1 month ago
parent
commit
332ee1b5b8
3 changed files with 8 additions and 2 deletions
  1. +2
    -0
      scenes/ui/waila.gd
  2. +5
    -0
      scenes/ui/waila.tscn
  3. +1
    -2
      scenes/world/world.gd

+ 2
- 0
scenes/ui/waila.gd View File

@ -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


+ 5
- 0
scenes/ui/waila.tscn View File

@ -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

+ 1
- 2
scenes/world/world.gd View File

@ -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):


Loading…
Cancel
Save