make button closeable

This commit is contained in:
April John 2023-11-29 17:59:33 +01:00
parent c561e855e1
commit dc7962a45d
1 changed files with 60 additions and 57 deletions

View File

@ -195,7 +195,10 @@ func _ready():
self.connect(\"toggled\", Callable(self, \"_on_toggled\")) self.connect(\"toggled\", Callable(self, \"_on_toggled\"))
func _on_toggled(was_button_pressed: bool): func _on_toggled(was_button_pressed: bool):
if get_parent().get_child(1).visible == false:
get_parent().get_child(1).visible = was_button_pressed get_parent().get_child(1).visible = was_button_pressed
else:
get_parent().get_child(1).visible = false
" "
[node name="Startup Menu" type="Panel"] [node name="Startup Menu" type="Panel"]