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.
27 lines
457 B
27 lines
457 B
extends Control
|
|
|
|
|
|
func _draw():
|
|
find_node("join").grab_focus()
|
|
|
|
|
|
func _on_join_pressed():
|
|
var ip = find_node("ip").text
|
|
|
|
if not ip.is_valid_ip_address():
|
|
show_error_dialog(tr("INVALIP_IP4"))
|
|
return
|
|
|
|
var port = find_node("port").text
|
|
client.join_game(ip, int(port))
|
|
queue_free()
|
|
|
|
|
|
func _on_back_pressed():
|
|
queue_free()
|
|
|
|
|
|
func show_error_dialog(text:String):
|
|
var dialog = get_node("error_dialog")
|
|
dialog.set_text(text)
|
|
dialog.popup_centered()
|