material-maker/addons/material_maker/widgets/node_editor/output.gd
Hugo Locurcio 93c84650cd
Add return type hints to all scripts
This also simplifies some functions.

This partially addresses #30.
2019-10-20 16:35:45 +02:00

25 lines
499 B
GDScript

tool
extends HBoxContainer
func set_model_data(data) -> void:
if data.has("rgb"):
$Type.selected = 1
$Value.text = data.rgb
elif data.has("rgba"):
$Type.selected = 2
$Value.text = data.rgba
elif data.has("f"):
$Type.selected = 0
$Value.text = data.f
func get_model_data() -> Dictionary:
if $Type.selected == 1:
return { rgb=$Value.text }
elif $Type.selected == 2:
return { rgba=$Value.text }
else:
return { f=$Value.text }
func _on_Delete_pressed() -> void:
queue_free()