From cf0086d12882354e9b28fdb3c97f277286ec2958 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 7 Dec 2025 22:52:51 +0100 Subject: [PATCH] feat: laid out "add primitive" buttons --- assets/icons/noise.svg | 45 +++++++++++++++++++++ assets/icons/plane.svg | 44 ++++++++++++++++++++ assets/icons/plus.svg | 57 ++++++++++++++++++++++++++ assets/icons/point.svg | 58 +++++++++++++++++++++++++++ project/assets/icons/noise.svg | 21 ++++++++++ project/assets/icons/noise.svg.import | 43 ++++++++++++++++++++ project/assets/icons/plane.svg | 21 ++++++++++ project/assets/icons/plane.svg.import | 43 ++++++++++++++++++++ project/assets/icons/plus.svg | 34 ++++++++++++++++ project/assets/icons/plus.svg.import | 43 ++++++++++++++++++++ project/assets/icons/point.svg | 34 ++++++++++++++++ project/assets/icons/point.svg.import | 43 ++++++++++++++++++++ project/scenes/editor.tscn | 45 ++++++++++++++++++--- 13 files changed, 525 insertions(+), 6 deletions(-) create mode 100644 assets/icons/noise.svg create mode 100644 assets/icons/plane.svg create mode 100644 assets/icons/plus.svg create mode 100644 assets/icons/point.svg create mode 100644 project/assets/icons/noise.svg create mode 100644 project/assets/icons/noise.svg.import create mode 100644 project/assets/icons/plane.svg create mode 100644 project/assets/icons/plane.svg.import create mode 100644 project/assets/icons/plus.svg create mode 100644 project/assets/icons/plus.svg.import create mode 100644 project/assets/icons/point.svg create mode 100644 project/assets/icons/point.svg.import diff --git a/assets/icons/noise.svg b/assets/icons/noise.svg new file mode 100644 index 00000000..cb6f14db --- /dev/null +++ b/assets/icons/noise.svg @@ -0,0 +1,45 @@ + + + + + + + + + + diff --git a/assets/icons/plane.svg b/assets/icons/plane.svg new file mode 100644 index 00000000..1243785f --- /dev/null +++ b/assets/icons/plane.svg @@ -0,0 +1,44 @@ + + + + + + + + + + diff --git a/assets/icons/plus.svg b/assets/icons/plus.svg new file mode 100644 index 00000000..b21e8ed2 --- /dev/null +++ b/assets/icons/plus.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + diff --git a/assets/icons/point.svg b/assets/icons/point.svg new file mode 100644 index 00000000..5d133500 --- /dev/null +++ b/assets/icons/point.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + + diff --git a/project/assets/icons/noise.svg b/project/assets/icons/noise.svg new file mode 100644 index 00000000..3b912f25 --- /dev/null +++ b/project/assets/icons/noise.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/project/assets/icons/noise.svg.import b/project/assets/icons/noise.svg.import new file mode 100644 index 00000000..1ddddbdb --- /dev/null +++ b/project/assets/icons/noise.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1te42w7wpkrx" +path="res://.godot/imported/noise.svg-9d5c97a404080be8eefda3e4fb7ca376.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/noise.svg" +dest_files=["res://.godot/imported/noise.svg-9d5c97a404080be8eefda3e4fb7ca376.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/assets/icons/plane.svg b/project/assets/icons/plane.svg new file mode 100644 index 00000000..5b485ccf --- /dev/null +++ b/project/assets/icons/plane.svg @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/project/assets/icons/plane.svg.import b/project/assets/icons/plane.svg.import new file mode 100644 index 00000000..0c85271d --- /dev/null +++ b/project/assets/icons/plane.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bl3gn6qruuy8w" +path="res://.godot/imported/plane.svg-408b84b2b3f5a78a3f7e786990573f38.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/plane.svg" +dest_files=["res://.godot/imported/plane.svg-408b84b2b3f5a78a3f7e786990573f38.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/assets/icons/plus.svg b/project/assets/icons/plus.svg new file mode 100644 index 00000000..ab78d77e --- /dev/null +++ b/project/assets/icons/plus.svg @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/project/assets/icons/plus.svg.import b/project/assets/icons/plus.svg.import new file mode 100644 index 00000000..88da4ff3 --- /dev/null +++ b/project/assets/icons/plus.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bb0mnjwx58nt3" +path="res://.godot/imported/plus.svg-7395cd59506febf409a5c6656903f8e9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/plus.svg" +dest_files=["res://.godot/imported/plus.svg-7395cd59506febf409a5c6656903f8e9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/assets/icons/point.svg b/project/assets/icons/point.svg new file mode 100644 index 00000000..1935aa50 --- /dev/null +++ b/project/assets/icons/point.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/project/assets/icons/point.svg.import b/project/assets/icons/point.svg.import new file mode 100644 index 00000000..7b105eb3 --- /dev/null +++ b/project/assets/icons/point.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b8hetdn3d3ysr" +path="res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/point.svg" +dest_files=["res://.godot/imported/point.svg-e68fd7c1e788d2c48d769cc58eba6e98.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/scenes/editor.tscn b/project/scenes/editor.tscn index 1cfc8810..2d390b5d 100644 --- a/project/scenes/editor.tscn +++ b/project/scenes/editor.tscn @@ -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"]