diff options
Diffstat (limited to 'UI/Lobby.gd')
| -rw-r--r-- | UI/Lobby.gd | 23 | 
1 files changed, 19 insertions, 4 deletions
| diff --git a/UI/Lobby.gd b/UI/Lobby.gd index d4eb7c2..4fea0bc 100644 --- a/UI/Lobby.gd +++ b/UI/Lobby.gd @@ -1,11 +1,26 @@  extends Control -func _on_button_pressed() -> void: -	Network.host_game() +func get_ip(): +	var ip := "127.0.0.1" +	if %IP.text: +		ip = %IP.text +	 +	return ip + + +func get_port(): +	var port := 1234 +	if %Port.text: +		port = %Port.text +	 +	return port + +func _on_host_pressed() -> void: +	Network.host_game(get_port())  	get_tree().change_scene_to_file("res://Stages/world.tscn") -func _on_button_2_pressed() -> void: -	Network.join_game() +func _on_join_pressed() -> void: +	Network.join_game(get_ip(), get_port())  	get_tree().change_scene_to_file("res://Stages/world.tscn") | 
