mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
93c84650cd
This also simplifies some functions. This partially addresses #30.
27 lines
537 B
GDScript
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" )
|