TinyAdventure/ui/debug_panel.gd

29 lines
930 B
GDScript
Raw Permalink Normal View History

extends Panel
var build_system:BuildSystem = null
@onready var build_system_active_label: Label = %BuildSystemActiveLabel
@onready var build_system_hover_object: Label = %BuildSystemHoverObject
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
if build_system == null:
build_system_active_label.text = "Not found"
build_system_hover_object.text = ""
return
if build_system.is_active:
build_system_active_label.text = "true"
else:
build_system_active_label.text = "false"
if build_system.hovered_existing_structure and not build_system.hovered_existing_structure.is_queued_for_deletion():
build_system_hover_object.text = build_system.hovered_existing_structure.get_path()
else:
build_system_hover_object.text = ""