2023-07-02 18:53:57 +00:00
|
|
|
extends Control
|
|
|
|
|
2023-07-23 18:55:33 +00:00
|
|
|
onready var player_name = $CenterContainer/VBoxContainer/GridContainer/NameLineEdit
|
2023-07-02 18:53:57 +00:00
|
|
|
|
2023-07-23 18:55:33 +00:00
|
|
|
onready var selected_IP = $CenterContainer/VBoxContainer/GridContainer/IPLineEdit
|
|
|
|
|
|
|
|
onready var selected_port = $CenterContainer/VBoxContainer/GridContainer/PortLineEdit
|
|
|
|
|
|
|
|
onready var waiting_room = $WaitingRoom
|
|
|
|
|
|
|
|
onready var ready_btn = $WaitingRoom/CenterContainer/VBoxContainer/ReadyButton
|
|
|
|
|
2023-08-06 17:37:50 +00:00
|
|
|
|
2023-07-23 18:55:33 +00:00
|
|
|
func _ready():
|
|
|
|
player_name.text = Save.save_data["player_name"]
|
|
|
|
selected_IP.text = Server.DEFAULT_IP
|
|
|
|
selected_port.text = str(Server.DEFAULT_PORT)
|
|
|
|
|
|
|
|
func show_waiting_room():
|
|
|
|
waiting_room.popup_centered()
|
|
|
|
|
|
|
|
func _on_ReadyBtn_pressed():
|
|
|
|
ready_btn.disabled = true
|
|
|
|
|
|
|
|
func _on_NameLineEdit_text_changed(_new_text):
|
|
|
|
Save.save_data["Player_name"] = player_name.text
|
|
|
|
Save.save_game()
|
|
|
|
|
|
|
|
func _on_JoinButton_pressed():
|
|
|
|
Server.selected_IP = selected_IP.text
|
|
|
|
Server.selected_port = int(selected_port.text)
|
2023-07-02 18:53:57 +00:00
|
|
|
Server._connect_to_server()
|
2023-07-23 18:55:33 +00:00
|
|
|
show_waiting_room()
|
|
|
|
|