cs-os/scripts/ConnectButton.gd

17 lines
397 B
GDScript3
Raw Normal View History

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():
button.text = "Click me"
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))