2019-10-12 08:30:46 +02:00
|
|
|
tool
|
|
|
|
extends MMGenTexture
|
|
|
|
class_name MMGenComment
|
|
|
|
|
|
|
|
"""
|
|
|
|
Comments to put in the graph
|
|
|
|
"""
|
|
|
|
|
|
|
|
var text : String = "Double-click to write a comment"
|
|
|
|
var size : Vector2 = Vector2(0, 0)
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func _ready() -> void:
|
2019-10-12 08:30:46 +02:00
|
|
|
if !parameters.has("size"):
|
|
|
|
parameters.size = 4
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func get_type() -> String:
|
2019-10-12 08:30:46 +02:00
|
|
|
return "comment"
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func get_type_name() -> String:
|
2019-10-12 08:30:46 +02:00
|
|
|
return "Comment"
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func get_parameter_defs() -> Array:
|
2019-10-12 08:30:46 +02:00
|
|
|
return []
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func get_input_defs() -> Array:
|
2019-10-12 08:30:46 +02:00
|
|
|
return []
|
2019-10-20 16:22:06 +02:00
|
|
|
|
|
|
|
func get_output_defs() -> Array:
|
2019-10-12 08:30:46 +02:00
|
|
|
return []
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func _serialize(data: Dictionary) -> Dictionary:
|
2019-10-12 08:30:46 +02:00
|
|
|
data.type = "comment"
|
|
|
|
data.text = text
|
|
|
|
data.size = { x=size.x, y=size.y }
|
|
|
|
return data
|
2019-11-04 07:58:17 +01:00
|
|
|
|
|
|
|
func _deserialize(data : Dictionary) -> void:
|
|
|
|
if data.has("text"):
|
|
|
|
text = data.text
|
|
|
|
if data.has("size"):
|
|
|
|
size = Vector2(data.size.x, data.size.y)
|