24 lines
465 B
GDScript
24 lines
465 B
GDScript
extends Node
|
|
|
|
var input_thread: Thread
|
|
|
|
|
|
func _enter_tree() -> void:
|
|
input_thread = Thread.new()
|
|
input_thread.start(_process_input)
|
|
|
|
|
|
func _exit_tree() -> void:
|
|
input_thread.wait_to_finish()
|
|
|
|
|
|
func _process_input() -> void:
|
|
var text := ""
|
|
while text != "quit":
|
|
print("Insert some text: ")
|
|
text = OS.read_string_from_stdin().strip_edges()
|
|
print("Inserted text: ",text)
|
|
if Referencer.chat:
|
|
Referencer.chat.send_server_message(text)
|
|
get_tree().quit()
|