Improved performance
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
class_name UIManager
|
||||
extends Control
|
||||
extends Node
|
||||
|
||||
signal chat_message_submitted(message: String)
|
||||
|
||||
@ -11,23 +11,13 @@ signal chat_message_submitted(message: String)
|
||||
@export var message_received: Signal
|
||||
|
||||
func _enter_tree():
|
||||
if get_node_or_null("/root/Main"):
|
||||
connect_main_scene()
|
||||
else:
|
||||
if !get_node_or_null("/root/Main"):
|
||||
connect_fake()
|
||||
|
||||
func connect_main_scene():
|
||||
login = %Login.success
|
||||
logout = %Logout.success
|
||||
ping_changed = %Ping.changed
|
||||
download_changed = %Client.download_changed
|
||||
upload_changed = %Client.upload_changed
|
||||
message_received = %Chat.message_received
|
||||
|
||||
func connect_fake():
|
||||
for property in get_property_list():
|
||||
if property.type != TYPE_SIGNAL:
|
||||
continue
|
||||
|
||||
add_user_signal(property.name)
|
||||
set(property.name, Signal(self, property.name))
|
||||
set(property.name, Signal(self, property.name))
|
||||
|
Reference in New Issue
Block a user