add back button

This commit is contained in:
Nitwel 2023-11-10 12:31:23 +01:00
parent 280b986455
commit 7dbdab6feb
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:034fb07ad84872c283141a5f2ae34989b349cdf77328cab5458a9263f58e4967
size 2984138
oid sha256:5dd5bdc3b7b21e92d97979f8e41b363fef7e6f8728aa6cc44ceee80a72c7cf91
size 3081472

View File

@ -40,6 +40,11 @@ func render_entities():
var entities = info["entities"]
var back_button = Entity.instantiate()
back_button.click.connect(_on_entity_click)
devices_node.add_child(back_button)
back_button.set_entity_name("#back")
for entity in entities:
var entity_instance = Entity.instantiate()
entity_instance.click.connect(_on_entity_click)
@ -56,10 +61,14 @@ func _on_device_click(device_id):
func _on_entity_click(entity_name):
print(entity_name)
selected_device = null
clear_menu()
render_devices()
if entity_name == "#back":
return
var type = entity_name.split(".")[0]
print(type)