feat: noise/plane primitiveinspectors
This commit is contained in:
parent
e22aeb49f6
commit
a1881f2af3
7 changed files with 107 additions and 48 deletions
|
|
@ -11,16 +11,10 @@ var value_before : float = 0.0
|
|||
var dragging := false
|
||||
|
||||
func connect_changes():
|
||||
$HSlider.connect(\"drag_ended\", _drag_ended)
|
||||
$HSlider.connect(\"drag_started\", _drag_started)
|
||||
$HSlider.connect(\"value_changed\", _slider_value_changed)
|
||||
$SpinBox.connect(\"value_changed\", _spin_value_changed)
|
||||
|
||||
func disconnect_changes():
|
||||
$HSlider.disconnect(\"drag_ended\", _drag_ended)
|
||||
$HSlider.disconnect(\"drag_started\", _drag_started)
|
||||
$HSlider.disconnect(\"value_changed\", _slider_value_changed)
|
||||
$SpinBox.disconnect(\"value_changed\", _spin_value_changed)
|
||||
$HSlider.drag_ended.connect(_drag_ended)
|
||||
$HSlider.drag_started.connect(_drag_started)
|
||||
$HSlider.value_changed.connect(_slider_value_changed)
|
||||
$SpinBox.value_changed.connect(_spin_value_changed)
|
||||
|
||||
func _ready() -> void:
|
||||
primitive.changed.connect(_primitive_changed)
|
||||
|
|
@ -56,11 +50,16 @@ offset_bottom = 31.0
|
|||
script = SubResource("GDScript_aclmm")
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="." unique_id=580598896]
|
||||
custom_minimum_size = Vector2(100, 0)
|
||||
layout_mode = 2
|
||||
min_value = -10000.0
|
||||
max_value = 100000.0
|
||||
step = 0.01
|
||||
value = 10.0
|
||||
allow_greater = true
|
||||
alignment = 2
|
||||
custom_arrow_step = 1.0
|
||||
custom_arrow_round = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="." unique_id=163542019]
|
||||
layout_mode = 2
|
||||
|
|
@ -69,3 +68,4 @@ size_flags_vertical = 1
|
|||
max_value = 300.0
|
||||
step = 0.01
|
||||
value = 200.0
|
||||
tick_count = 4
|
||||
|
|
|
|||
|
|
@ -10,13 +10,19 @@ script/source = "extends OptionButton
|
|||
@onready var terrain : TerrainMeshEditor = $\"../../..\".terrain
|
||||
@onready var primitive : TerrainPrimitive = terrain.current_selected
|
||||
|
||||
func _ready():
|
||||
selected = primitive.blend_mode
|
||||
primitive.changed.connect(_primitive_changed)
|
||||
|
||||
func _primitive_changed():
|
||||
selected = primitive.blend_mode
|
||||
|
||||
func _on_item_selected(index: int) -> void:
|
||||
var before : int = primitive.blend_mode
|
||||
EditHistory.push_action(primitive.set_blend_mode.bind(index), primitive.set_blend_mode.bind(before))
|
||||
"
|
||||
|
||||
[node name="PointPrimitive" type="MarginContainer" unique_id=905749607]
|
||||
[node name="Primitive" type="MarginContainer" unique_id=905749607]
|
||||
offset_right = 302.0
|
||||
offset_bottom = 230.0
|
||||
theme_override_constants/margin_left = 5
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
[gd_scene format=3 uid="uid://c5desl3kt72c7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bl16us512blpp" path="res://ui/primitive_inspectors/base_primitive_inspector.tscn" id="1_xrxbf"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwby0in0f2wi2" path="res://ui/editor_elements/float_editor.tscn" id="2_sg7mg"]
|
||||
|
||||
[node name="NoisePrimitive" unique_id=905749607 instance=ExtResource("1_xrxbf")]
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="0" unique_id=273381442]
|
||||
layout_mode = 2
|
||||
text = "Noise Scale"
|
||||
|
||||
[node name="FloatEditor" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="1" unique_id=1730998858 instance=ExtResource("2_sg7mg")]
|
||||
layout_mode = 2
|
||||
changes_value = "noise_scale"
|
||||
|
||||
[node name="SpinBox" parent="VBoxContainer/FloatEditor" index="0" unique_id=580598896]
|
||||
min_value = 0.01
|
||||
suffix = "x"
|
||||
|
||||
[node name="HSlider" parent="VBoxContainer/FloatEditor" index="1" unique_id=163542019]
|
||||
min_value = 0.01
|
||||
max_value = 100.0
|
||||
value = 10.0
|
||||
exp_edit = true
|
||||
tick_count = 3
|
||||
|
||||
[node name="Label2" type="Label" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="2" unique_id=1672112548]
|
||||
layout_mode = 2
|
||||
text = "Noise Amplitude"
|
||||
|
||||
[node name="FloatEditor2" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="3" unique_id=826068898 instance=ExtResource("2_sg7mg")]
|
||||
layout_mode = 2
|
||||
changes_value = "noise_amplitude"
|
||||
|
||||
[node name="SpinBox" parent="VBoxContainer/FloatEditor2" index="0" unique_id=580598896]
|
||||
min_value = 0.01
|
||||
prefix = "±"
|
||||
suffix = "m"
|
||||
|
||||
[node name="HSlider" parent="VBoxContainer/FloatEditor2" index="1" unique_id=163542019]
|
||||
min_value = 0.01
|
||||
exp_edit = true
|
||||
tick_count = 3
|
||||
|
||||
[editable path="VBoxContainer/FloatEditor"]
|
||||
[editable path="VBoxContainer/FloatEditor2"]
|
||||
[editable path="VBoxContainer/FloatEditor3"]
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene format=3 uid="uid://cq25h75v1bnn1"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bl16us512blpp" path="res://ui/primitive_inspectors/base_primitive_inspector.tscn" id="1_6yw1a"]
|
||||
[ext_resource type="PackedScene" uid="uid://cwby0in0f2wi2" path="res://ui/editor_elements/float_editor.tscn" id="2_rbqm7"]
|
||||
|
||||
[node name="PlanePrimitive" unique_id=905749607 instance=ExtResource("1_6yw1a")]
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="0" unique_id=1175716242]
|
||||
layout_mode = 2
|
||||
text = "Baseline"
|
||||
|
||||
[node name="FloatEditor" parent="VBoxContainer" parent_id_path=PackedInt32Array(236606520) index="1" unique_id=1730998858 instance=ExtResource("2_rbqm7")]
|
||||
layout_mode = 2
|
||||
changes_value = "baseline"
|
||||
|
||||
[editable path="VBoxContainer/FloatEditor3"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue