2024-02-07 23:25:08 +03:00
|
|
|
extends Button
|
|
|
|
|
|
|
|
@onready var button = $"."
|
|
|
|
@onready var ip_input: TextEdit = $"../IP"
|
|
|
|
@onready var port_input: TextEdit = $"../Port"
|
|
|
|
|
|
|
|
func _ready():
|
2024-02-12 00:11:50 +03:00
|
|
|
button.text = "Connect"
|
2024-02-07 23:25:08 +03:00
|
|
|
button.pressed.connect(self._button_pressed)
|
|
|
|
|
|
|
|
func _button_pressed():
|
|
|
|
var ip = ip_input.text
|
|
|
|
var port = port_input.text
|
|
|
|
print("Trying to connect to " + ip + ":" + port)
|
|
|
|
Networking.ConnectToServer(str(ip), int(port))
|
|
|
|
|