Login.gd 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. extends Node
  2. var client = preload('res://Client.tscn')
  3. var server = preload('res://Server.tscn')
  4. signal login_confimed
  5. var login_await = true
  6. func _ready():
  7. for i in get_children():
  8. i.hide()
  9. $directconnect.show()
  10. func _on_Button_button_down():
  11. $directconnect.hide()
  12. $loginscreen.show()
  13. if login_await: yield(self,'login_confimed')
  14. $loginscreen.hide()
  15. var client2 = client.instance()
  16. var ip = $directconnect/VBoxContainer/HBoxContainer/LineEdit2.get_text()
  17. var port = $directconnect/VBoxContainer/HBoxContainer/LineEdit.get_text()
  18. client2.ip = ip
  19. client2.port = int(port)
  20. get_parent().add_child(client2)
  21. pass # Replace with function body.
  22. func _on_Button2_button_down():
  23. var server2 = server.instance()
  24. get_parent().add_child(server2)
  25. pass # Replace with function body.
  26. func _on_CheckButton_toggled(button_pressed):
  27. login_await = button_pressed
  28. pass # Replace with function body.
  29. func _on_register_button_down():
  30. $loginscreen.hide()
  31. $register.show()
  32. pass # Replace with function body.
  33. func _on_login2_button_down():
  34. $loginscreen.show()
  35. $register.hide()
  36. pass # Replace with function body.