2018-10-28 16:26:37 +01:00
|
|
|
tool
|
|
|
|
extends HBoxContainer
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func get_model_data() -> Dictionary:
|
|
|
|
var data = {
|
|
|
|
min = $Min.value,
|
|
|
|
max = $Max.value,
|
|
|
|
step = $Step.value,
|
|
|
|
default = $Default.value,
|
|
|
|
}
|
2018-10-28 16:26:37 +01:00
|
|
|
|
|
|
|
if $SpinBox.pressed:
|
|
|
|
data.widget = "spinbox"
|
2019-10-20 16:22:06 +02:00
|
|
|
|
2018-10-28 16:26:37 +01:00
|
|
|
return data
|
|
|
|
|
2019-10-20 16:22:06 +02:00
|
|
|
func set_model_data(data) -> void:
|
2018-10-28 16:26:37 +01:00
|
|
|
if data.has("min"):
|
|
|
|
$Min.value = data.min
|
|
|
|
if data.has("max"):
|
|
|
|
$Max.value = data.max
|
|
|
|
if data.has("step"):
|
|
|
|
$Step.value = data.step
|
2018-10-28 17:06:42 +01:00
|
|
|
if data.has("default"):
|
|
|
|
$Default.value = data.default
|
2018-10-28 16:26:37 +01:00
|
|
|
$SpinBox.pressed = ( data.has("widget") && data.widget == "spinbox" )
|