moved chat to new ChatPanel and added smooth bottom scrolling when new message is received
This commit is contained in:
@@ -19,7 +19,8 @@ extends Control
|
||||
@export var output: Label
|
||||
|
||||
func _write_line(text: String) -> void:
|
||||
output.text += text + "\n"
|
||||
#output.text += text + "\n"
|
||||
pass
|
||||
|
||||
func _on_create_lobby_button_pressed() -> void:
|
||||
client.create_lobby(name_input.text.strip_edges())
|
||||
@@ -63,12 +64,6 @@ func _on_web_client_tcp_client_joined_lobby(client_name: String, connected_clien
|
||||
}))
|
||||
_update_connected_players(connected_client_names)
|
||||
|
||||
func _on_web_client_tcp_received_chat_message(client_name: String, message: String) -> void:
|
||||
_write_line("<{client_name}> {message}".format({
|
||||
"client_name": client_name,
|
||||
"message": message,
|
||||
}))
|
||||
|
||||
func _on_web_client_tcp_client_left_lobby(client_name: String, connected_client_names: Array) -> void:
|
||||
_write_line("{client_name} left the lobby".format({"client_name": client_name}))
|
||||
_update_connected_players(connected_client_names)
|
||||
|
||||
Reference in New Issue
Block a user