Chelimbalo/scripts/debug/property_shower.gd
2025-11-26 23:04:24 +05:00

21 lines
738 B
GDScript

extends VBoxContainer
@export var property_array: Dictionary[NodePath,StringName]
func _ready() -> void:
for target in property_array.keys():
var hbox = HBoxContainer.new()
var name_label = Label.new()
var splitted = property_array[target].split(":")
name_label.text = splitted[len(splitted)-1]
name_label.name = "Name"
var value_label = Label.new()
value_label.name = "Value"
hbox.add_child(name_label,true)
hbox.add_child(value_label,true)
hbox.name = str(target).replace("/","_").replace(".","")
add_child(hbox,true)
func _process(_delta: float) -> void:
for target in property_array:
get_node(str(target).replace("/","_").replace(".","")+"/Value").text = str(get_node(target).get(property_array[target]))