clients now auto-connect to server, omitting the connection step and hiding the server URL from the frontend
This commit is contained in:
+9
-3
@@ -33,9 +33,6 @@ func _send_chat_message() -> void:
|
||||
message_sent.emit(message_input.text.strip_edges())
|
||||
message_input.text = ""
|
||||
|
||||
func _on_web_client_user_message_received(sender: String, message: String) -> void:
|
||||
put_chat_message(sender, message)
|
||||
|
||||
func _on_message_input_text_changed(new_text: String) -> void:
|
||||
send_message_button.disabled = new_text.is_empty()
|
||||
|
||||
@@ -45,3 +42,12 @@ func _on_message_input_gui_input(event: InputEvent) -> void:
|
||||
|
||||
func _on_send_message_button_pressed() -> void:
|
||||
_send_chat_message()
|
||||
|
||||
|
||||
func _on_web_client_connection_status_changed(new_status: WebClient.ConnectionStatus) -> void:
|
||||
if new_status == WebClient.ConnectionStatus.JOINED:
|
||||
message_input.editable = true
|
||||
send_message_button.disabled = false
|
||||
else:
|
||||
message_input.editable = false
|
||||
send_message_button.disabled = true
|
||||
|
||||
Reference in New Issue
Block a user