add back button
This commit is contained in:
parent
280b986455
commit
7dbdab6feb
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:034fb07ad84872c283141a5f2ae34989b349cdf77328cab5458a9263f58e4967
|
oid sha256:5dd5bdc3b7b21e92d97979f8e41b363fef7e6f8728aa6cc44ceee80a72c7cf91
|
||||||
size 2984138
|
size 3081472
|
||||||
|
|
|
@ -40,6 +40,11 @@ func render_entities():
|
||||||
|
|
||||||
var entities = info["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:
|
for entity in entities:
|
||||||
var entity_instance = Entity.instantiate()
|
var entity_instance = Entity.instantiate()
|
||||||
entity_instance.click.connect(_on_entity_click)
|
entity_instance.click.connect(_on_entity_click)
|
||||||
|
@ -56,10 +61,14 @@ func _on_device_click(device_id):
|
||||||
|
|
||||||
func _on_entity_click(entity_name):
|
func _on_entity_click(entity_name):
|
||||||
print(entity_name)
|
print(entity_name)
|
||||||
|
|
||||||
selected_device = null
|
selected_device = null
|
||||||
clear_menu()
|
clear_menu()
|
||||||
render_devices()
|
render_devices()
|
||||||
|
|
||||||
|
if entity_name == "#back":
|
||||||
|
return
|
||||||
|
|
||||||
var type = entity_name.split(".")[0]
|
var type = entity_name.split(".")[0]
|
||||||
print(type)
|
print(type)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user