28 lines
697 B
GDScript3
Raw Normal View History

2026-04-13 11:34:00 -05:00
extends Node
@onready var session_label: Label = %SessionLabel
@onready var join_session_id: LineEdit = %JoinSessionId
@onready var tube_client: TubeClient = %TubeClient
@onready var chat_log: RichTextLabel = %ChatLabel
@onready var chat_text_input: LineEdit = %ChatTextInput
2026-04-13 11:34:00 -05:00
func handle_create_session():
tube_client.create_session()
session_label.text = tube_client.session_id
2026-04-13 11:34:00 -05:00
func handle_join_session():
tube_client.join_session(join_session_id.text)
session_label.text = tube_client.session_id
func handle_chat_update(new_text):
update_chat.rpc(new_text)
chat_text_input.text = ""
2026-04-13 11:34:00 -05:00
@rpc("any_peer", "call_local", "reliable")
func update_chat(text):
chat_log.text += text + "\n"