25 lines
475 B
GDScript
25 lines
475 B
GDScript
# Socket.gd
|
|
extends TextureButton
|
|
class_name Socket
|
|
|
|
signal socket_selected(socket: Socket)
|
|
|
|
enum SocketType { INPUT, OUTPUT }
|
|
|
|
enum SocketDataTypes {
|
|
FLOAT, INT, STRING, EXEC
|
|
}
|
|
|
|
var socket_name: String
|
|
var socket_type: SocketType
|
|
|
|
# Called by the parent component block to set up the socket.
|
|
func initialize(s_name: String, s_type: SocketType):
|
|
socket_name = s_name
|
|
socket_type = s_type
|
|
|
|
tooltip_text = socket_name
|
|
|
|
func _pressed() -> void:
|
|
socket_selected.emit(self)
|