material-maker/addons/material_maker/widgets/node_editor/parameter_float.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

27 lines
537 B
GDScript

tool
extends HBoxContainer
func get_model_data() -> Dictionary:
var data = {
min = $Min.value,
max = $Max.value,
step = $Step.value,
default = $Default.value,
}
if $SpinBox.pressed:
data.widget = "spinbox"
return data
func set_model_data(data) -> void:
if data.has("min"):
$Min.value = data.min
if data.has("max"):
$Max.value = data.max
if data.has("step"):
$Step.value = data.step
if data.has("default"):
$Default.value = data.default
$SpinBox.pressed = ( data.has("widget") && data.widget == "spinbox" )