fix: non-functional UI elements
This commit is contained in:
parent
d736506eb4
commit
32c6c7529e
14 changed files with 253 additions and 17 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[ext_resource type="PackedScene" uid="uid://cwby0in0f2wi2" path="res://ui/editor_elements/float_editor.tscn" id="1_dildi"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt72qid068u8u" path="res://assets/icons/delete.svg" id="1_h3glg"]
|
||||
[ext_resource type="Texture2D" uid="uid://dnkv4js7q0lsd" path="res://assets/icons/duplicate.png" id="3_ivj30"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_h3glg"]
|
||||
resource_name = "BlendModeSelector"
|
||||
|
|
@ -45,11 +46,15 @@ func _primitive_changed():
|
|||
$\"../ExpressionError\".text = primitive.get_expression_error()
|
||||
|
||||
func _text_changed():
|
||||
if not pushing_change:
|
||||
if not pushing_change and has_focus():
|
||||
$ExpressionTimerBuffer.stop()
|
||||
$ExpressionTimerBuffer.start(0.5)
|
||||
|
||||
func _timeout():
|
||||
primitive.expression = text
|
||||
if not pushing_change:
|
||||
pushing_change = true
|
||||
primitive.expression = text
|
||||
pushing_change = false
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_ivj30"]
|
||||
|
|
@ -65,6 +70,17 @@ func _pressed() -> void:
|
|||
terrain.current_selected = null
|
||||
"
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_osefh"]
|
||||
resource_name = "DuplicatePrimitive"
|
||||
script/source = "extends Button
|
||||
|
||||
@onready var terrain : TerrainMeshEditor = ($\"../../../..\" as LayerEditor).terrain
|
||||
@onready var primitive : TerrainPrimitive = terrain.current_selected
|
||||
|
||||
func _pressed() -> void:
|
||||
terrain.add_primitive(primitive.duplicate_deep())
|
||||
"
|
||||
|
||||
[node name="Primitive" type="MarginContainer" unique_id=905749607]
|
||||
offset_right = 302.0
|
||||
offset_bottom = 230.0
|
||||
|
|
@ -112,7 +128,7 @@ script = SubResource("GDScript_h3glg")
|
|||
[node name="Expression" type="TextEdit" parent="VBoxContainer" unique_id=1154146381]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
placeholder_text = "previous_height * previous_height"
|
||||
placeholder_text = "Heightmap Override (float)"
|
||||
backspace_deletes_composite_character_enabled = true
|
||||
caret_blink = true
|
||||
caret_move_on_right_click = false
|
||||
|
|
@ -121,7 +137,7 @@ draw_spaces = true
|
|||
script = SubResource("GDScript_2i6ni")
|
||||
|
||||
[node name="ExpressionTimerBuffer" type="Timer" parent="VBoxContainer/Expression" unique_id=1376932514]
|
||||
wait_time = 2.0
|
||||
wait_time = 0.5
|
||||
|
||||
[node name="ExpressionError" type="Label" parent="VBoxContainer" unique_id=1840569033]
|
||||
layout_mode = 2
|
||||
|
|
@ -131,7 +147,7 @@ text = "Error Text"
|
|||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer" unique_id=1514690251]
|
||||
[node name="DeleteButton" type="Button" parent="VBoxContainer/HBoxContainer" unique_id=1514690251]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("1_h3glg")
|
||||
|
|
@ -139,6 +155,14 @@ icon_alignment = 1
|
|||
expand_icon = true
|
||||
script = SubResource("GDScript_ivj30")
|
||||
|
||||
[node name="DuplicateButton" type="Button" parent="VBoxContainer/HBoxContainer" unique_id=1329310966]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("3_ivj30")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
script = SubResource("GDScript_osefh")
|
||||
|
||||
[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