feat: new primitives get selected immediately
This commit is contained in:
parent
33da5f1772
commit
d736506eb4
6 changed files with 37 additions and 30 deletions
|
|
@ -101,10 +101,8 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||
load_path = "res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"
|
||||
|
||||
[sub_resource type="PointPrimitive" id="PointPrimitive_5lcyj"]
|
||||
expression = "sloped_height"
|
||||
|
||||
[sub_resource type="PlanePrimitive" id="PlanePrimitive_5lcyj"]
|
||||
expression = "baseline"
|
||||
|
||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_3vi5u"]
|
||||
frequency = 0.0336
|
||||
|
|
@ -115,7 +113,6 @@ domain_warp_fractal_lacunarity = 5.512
|
|||
domain_warp_fractal_gain = 0.662
|
||||
|
||||
[sub_resource type="NoisePrimitive" id="NoisePrimitive_5lcyj"]
|
||||
expression = "previous_height + noise_sample"
|
||||
noise = SubResource("FastNoiseLite_3vi5u")
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_74j0u"]
|
||||
|
|
|
|||
|
|
@ -22,19 +22,6 @@ func _on_item_selected(index: int) -> void:
|
|||
EditHistory.push_action(primitive.set_blend_mode.bind(index), primitive.set_blend_mode.bind(before))
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ivj30"]
|
||||
resource_name = "DeletePrimitive"
|
||||
script/source = "extends Button
|
||||
|
||||
@onready var terrain : TerrainMeshEditor = ($\"../../../..\" as LayerEditor).terrain
|
||||
@onready var primitive : TerrainPrimitive = terrain.current_selected
|
||||
|
||||
func _pressed() -> void:
|
||||
var idx : int = terrain.primitives.find(primitive)
|
||||
EditHistory.push_action(terrain.remove_primitive.bind(primitive), terrain.insert_primitive.bind(primitive, idx))
|
||||
terrain.current_selected = null
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_2i6ni"]
|
||||
resource_name = "ExpressionEditor"
|
||||
script/source = "extends TextEdit
|
||||
|
|
@ -65,6 +52,19 @@ func _timeout():
|
|||
primitive.expression = text
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ivj30"]
|
||||
resource_name = "DeletePrimitive"
|
||||
script/source = "extends Button
|
||||
|
||||
@onready var terrain : TerrainMeshEditor = ($\"../../../..\" as LayerEditor).terrain
|
||||
@onready var primitive : TerrainPrimitive = terrain.current_selected
|
||||
|
||||
func _pressed() -> void:
|
||||
var idx : int = terrain.primitives.find(primitive)
|
||||
EditHistory.push_action(terrain.remove_primitive.bind(primitive), terrain.insert_primitive.bind(primitive, idx))
|
||||
terrain.current_selected = null
|
||||
"
|
||||
|
||||
[node name="Primitive" type="MarginContainer" unique_id=905749607]
|
||||
offset_right = 302.0
|
||||
offset_bottom = 230.0
|
||||
|
|
@ -109,22 +109,10 @@ popup/item_2/text = "Both"
|
|||
popup/item_2/id = 2
|
||||
script = SubResource("GDScript_h3glg")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=274380821]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer" unique_id=1514690251]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("1_h3glg")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
script = SubResource("GDScript_ivj30")
|
||||
|
||||
[node name="Expression" type="TextEdit" parent="VBoxContainer" unique_id=1154146381]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
placeholder_text = "expression"
|
||||
placeholder_text = "previous_height * previous_height"
|
||||
backspace_deletes_composite_character_enabled = true
|
||||
caret_blink = true
|
||||
caret_move_on_right_click = false
|
||||
|
|
@ -139,6 +127,18 @@ wait_time = 2.0
|
|||
layout_mode = 2
|
||||
text = "Error Text"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=274380821]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer" unique_id=1514690251]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("1_h3glg")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
script = SubResource("GDScript_ivj30")
|
||||
|
||||
[connection signal="item_selected" from="VBoxContainer/BlendModeSelector" to="VBoxContainer/BlendModeSelector" method="_on_item_selected"]
|
||||
|
||||
[editable path="VBoxContainer/FloatEditor3"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue