Improved signal handling
This commit is contained in:
parent
4ad50e75db
commit
fba99ed432
@ -3,21 +3,12 @@ extends Control
|
|||||||
|
|
||||||
signal chat_message_submitted(message: String)
|
signal chat_message_submitted(message: String)
|
||||||
|
|
||||||
var signals := [
|
@export var login: Signal
|
||||||
"login",
|
@export var logout: Signal
|
||||||
"logout",
|
@export var ping_changed: Signal
|
||||||
"ping_changed",
|
@export var download_changed: Signal
|
||||||
"download_changed",
|
@export var upload_changed: Signal
|
||||||
"upload_changed",
|
@export var message_received: Signal
|
||||||
"message_received",
|
|
||||||
]
|
|
||||||
|
|
||||||
var login: Signal
|
|
||||||
var logout: Signal
|
|
||||||
var ping_changed: Signal
|
|
||||||
var download_changed: Signal
|
|
||||||
var upload_changed: Signal
|
|
||||||
var message_received: Signal
|
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
if get_node_or_null("/root/Main"):
|
if get_node_or_null("/root/Main"):
|
||||||
@ -34,6 +25,9 @@ func connect_main_scene():
|
|||||||
message_received = %Chat.message_received
|
message_received = %Chat.message_received
|
||||||
|
|
||||||
func connect_fake():
|
func connect_fake():
|
||||||
for signal_name in signals:
|
for property in get_property_list():
|
||||||
set(signal_name, Signal(self, signal_name))
|
if property.type != TYPE_SIGNAL:
|
||||||
add_user_signal(signal_name)
|
continue
|
||||||
|
|
||||||
|
add_user_signal(property.name)
|
||||||
|
set(property.name, Signal(self, property.name))
|
Loading…
Reference in New Issue
Block a user