mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
78bb4551a8
Also added default value to float, boolean and enum parameters
28 lines
491 B
GDScript
28 lines
491 B
GDScript
tool
|
|
extends HBoxContainer
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func set_model_data(data):
|
|
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():
|
|
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():
|
|
queue_free()
|