add message_sent signal to consoler
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
extends Node
|
||||
|
||||
signal message_sent(message: String)
|
||||
|
||||
var input_thread: Thread
|
||||
var stop: bool = false
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
@@ -9,15 +12,15 @@ func _enter_tree() -> void:
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
stop = true
|
||||
input_thread.wait_to_finish()
|
||||
|
||||
|
||||
func _process_input() -> void:
|
||||
var text := ""
|
||||
while text != "quit":
|
||||
print("Insert some text: ")
|
||||
while not stop and text != "quit":
|
||||
text = OS.read_string_from_stdin().strip_edges()
|
||||
print("Inserted text: ",text)
|
||||
if Referencer.chat:
|
||||
Referencer.chat.send_server_message(text)
|
||||
get_tree().quit()
|
||||
if text and Referencer.chat:
|
||||
print("Inserted text: ", text)
|
||||
message_sent.emit(text)
|
||||
print("STOPPING!")
|
||||
|
||||
Reference in New Issue
Block a user