feat: laid out "add primitive" buttons

This commit is contained in:
Sara Gerretsen 2025-12-07 22:52:51 +01:00
parent fab10c4feb
commit cf0086d128
13 changed files with 525 additions and 6 deletions

View file

@ -3,6 +3,9 @@
[ext_resource type="PackedScene" uid="uid://cnux2fqne284i" path="res://objects/primitive_nodes/point_primitive_node.tscn" id="1_b1cmn"]
[ext_resource type="PackedScene" uid="uid://wkqhvjnxs2mx" path="res://objects/terrain_chunk.tscn" id="1_pxqd5"]
[ext_resource type="Theme" uid="uid://dh5hqcu3vyhrh" path="res://editor_theme.tres" id="3_ba0ut"]
[ext_resource type="Texture2D" uid="uid://bb0mnjwx58nt3" path="res://assets/icons/plus.svg" id="4_q68jb"]
[ext_resource type="Texture2D" uid="uid://bl3gn6qruuy8w" path="res://assets/icons/plane.svg" id="4_xg7d5"]
[ext_resource type="Texture2D" uid="uid://d1te42w7wpkrx" path="res://assets/icons/noise.svg" id="5_eqbpn"]
[sub_resource type="PointPrimitive" id="PointPrimitive_pxqd5"]
slope = -0.7
@ -120,6 +123,9 @@ func _unhandled_input(event: InputEvent) -> void:
global_position = (global_position - pivot).normalized() * distance + pivot
"
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_xg7d5"]
load_path = "res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"
[node name="Editor" type="Node3D" unique_id=1027707839]
[node name="TerrainMeshEditor" type="TerrainMeshEditor" parent="." unique_id=1382595562]
@ -161,17 +167,44 @@ grow_horizontal = 2
grow_vertical = 2
current_tab = 0
[node name="MarginContainer" type="MarginContainer" parent="LeftPanel/TabContainer" unique_id=1533578826]
[node name="Layers" type="VBoxContainer" parent="LeftPanel/TabContainer" unique_id=138865385]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
metadata/_tab_index = 0
[node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/TabContainer/MarginContainer" unique_id=797700186 node_paths=PackedStringArray("terrain")]
[node name="Tree" type="PrimitiveLayerList" parent="LeftPanel/TabContainer/Layers" unique_id=797700186 node_paths=PackedStringArray("terrain")]
layout_mode = 2
size_flags_vertical = 3
columns = 4
drop_mode_flags = 2
select_mode = 1
terrain = NodePath("../../../../TerrainMeshEditor")
[node name="HBoxContainer" type="HBoxContainer" parent="LeftPanel/TabContainer/Layers" unique_id=702489990]
layout_mode = 2
size_flags_vertical = 8
alignment = 1
[node name="TextureRect" type="TextureRect" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=1669840346]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
texture = ExtResource("4_q68jb")
expand_mode = 2
stretch_mode = 4
[node name="AddPointPrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=535482641]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = SubResource("CompressedTexture2D_xg7d5")
expand_icon = true
[node name="AddPlanePrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=287076599]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = ExtResource("4_xg7d5")
expand_icon = true
[node name="AddNoisePrimitive" type="Button" parent="LeftPanel/TabContainer/Layers/HBoxContainer" unique_id=769590598]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
icon = ExtResource("5_eqbpn")
expand_icon = true
[connection signal="primitives_changed" from="TerrainMeshEditor" to="TerrainMeshEditor" method="_on_primitives_changed"]