mirror of
https://github.com/Relintai/material-maker.git
synced 2024-12-23 21:16:54 +01:00
78bb4551a8
Also added default value to float, boolean and enum parameters
27 lines
545 B
GDScript
27 lines
545 B
GDScript
tool
|
|
extends HBoxContainer
|
|
|
|
func _ready():
|
|
pass
|
|
|
|
func get_model_data():
|
|
var data = {}
|
|
data.min = $Min.value
|
|
data.max = $Max.value
|
|
data.step = $Step.value
|
|
data.default = $Default.value
|
|
if $SpinBox.pressed:
|
|
data.widget = "spinbox"
|
|
return data
|
|
|
|
func set_model_data(data):
|
|
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" )
|