Public repository for MUR pre alpha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
775 B

  1. extends Control
  2. var LobbyMenu = preload("res://scenes/menus/LobbyMenu.tscn")
  3. func _ready():
  4. find_node("bots").set_pressed(config.get_value("game","bots", true))
  5. func _draw():
  6. find_node("host").grab_focus()
  7. func _on_host_pressed():
  8. var port = find_node("port").get_value()
  9. var bots = find_node("bots").is_pressed()
  10. var err = server.host_game(int(port), bots)
  11. if err == OK:
  12. var lobby_menu = LobbyMenu.instance()
  13. get_tree().get_root().add_child(lobby_menu)
  14. gamestate.set_player(get_tree().get_network_unique_id())
  15. queue_free()
  16. else:
  17. _on_back_pressed()
  18. get_tree().get_root().get_node("multiplayer_menu").show_error_dialog(tr("ERROR_SERVER_CREATION"))
  19. func _on_back_pressed():
  20. queue_free()
  21. get_tree().get_root().get_node("multiplayer_menu").show()