Add step as a parameter to add_slot_float.

This commit is contained in:
Relintai 2021-10-04 15:00:00 +02:00
parent ef784088b4
commit 679e992ef8
2 changed files with 26 additions and 2 deletions

View File

@ -44,7 +44,7 @@ func add_slot_int(input_type : int, output_type : int, getter : String, setter :
sb.connect("value_changed", self, "on_int_spinbox_value_changed", [ slot_idx ])
func add_slot_float(input_type : int, output_type : int, getter : String, setter : String, slot_name : String) -> void:
func add_slot_float(input_type : int, output_type : int, getter : String, setter : String, slot_name : String, step : float = 0.1) -> void:
var bc : VBoxContainer = VBoxContainer.new()
if slot_name != "":
@ -57,7 +57,7 @@ func add_slot_float(input_type : int, output_type : int, getter : String, setter
var slot_idx : int = add_slot(input_type, output_type, getter, setter, bc)
sb.rounded = false
sb.step = 0
sb.step = step
sb.value = _node.call(getter)
sb.connect("value_changed", self, "on_float_spinbox_value_changed", [ slot_idx ])

View File

@ -0,0 +1,24 @@
[gd_resource type="Resource" load_steps=6 format=2]
[ext_resource path="res://addons/mat_maker_gd/nodes/mm_material.gd" type="Script" id=1]
[ext_resource path="res://addons/mat_maker_gd/nodes/noise/perlin.gd" type="Script" id=2]
[ext_resource path="res://addons/mat_maker_gd/nodes/noise/noise.gd" type="Script" id=3]
[sub_resource type="Resource" id=1]
script = ExtResource( 2 )
graph_position = Vector2( -520, -340 )
scale = Vector2( 15, 4 )
iterations = 3
persistence = 0.5
[sub_resource type="Resource" id=2]
script = ExtResource( 3 )
graph_position = Vector2( 0, 0 )
bmin = Vector2( 0.1, 0.1 )
bmax = Vector2( 1, 1 )
refresh = false
[resource]
script = ExtResource( 1 )
image_size = Vector2( 128, 128 )
nodes = [ SubResource( 1 ), SubResource( 2 ) ]