From f8334ddf2b374a97b63fdbbb20db8c6239a3241d Mon Sep 17 00:00:00 2001 From: Michal Stachowicz Date: Sun, 7 Apr 2024 11:17:48 +0100 Subject: [PATCH] Add UI options for creating particle emitters. --- source/UI/Editor.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/UI/Editor.cpp b/source/UI/Editor.cpp index c373ca8..5492440 100644 --- a/source/UI/Editor.cpp +++ b/source/UI/Editor.cpp @@ -635,18 +635,33 @@ namespace UI Component::Mesh{m_mesh_system.m_cube}, Component::Collider{}); } - else if (ImGui::Button("Light")) + else if (ImGui::Button("Terrain")) + { + m_scene_system.get_current_scene_entities().add_entity( + Component::Label{"Terrain"}, + Component::Terrain{*m_cursor_intersection, 10, 10}); + } + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Light")) + { + if (ImGui::Button("Point light")) { m_scene_system.get_current_scene_entities().add_entity( Component::Label{"Light"}, Component::Transform{*m_cursor_intersection}, Component::PointLight{*m_cursor_intersection}); } - else if (ImGui::Button("Terrain")) + ImGui::EndMenu(); + } + if (ImGui::BeginMenu("Particle")) + { + if (ImGui::Button("Smoke")) { m_scene_system.get_current_scene_entities().add_entity( - Component::Label{"Terrain"}, - Component::Terrain{*m_cursor_intersection, 10, 10}); + Component::Label{"Particle Emitter"}, + Component::Transform{*m_cursor_intersection}, + Component::ParticleEmitter{m_texture_system.getTexture(Config::Texture_Directory / "smoke.png")}); } ImGui::EndMenu(); }