From 60b0f15caf47e821874fc4da4701197059b9c5f1 Mon Sep 17 00:00:00 2001 From: Astral-C Date: Sun, 29 Oct 2023 11:43:30 -0400 Subject: [PATCH] move add object button to bottom of layer --- src/DOM/ZoneDOMNode.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/DOM/ZoneDOMNode.cpp b/src/DOM/ZoneDOMNode.cpp index a3e2198..1dff51d 100644 --- a/src/DOM/ZoneDOMNode.cpp +++ b/src/DOM/ZoneDOMNode.cpp @@ -109,38 +109,34 @@ void SZoneLayerDOMNode::RenderHeirarchyUI(std::shared_ptr& selecte ImGui::SameLine(); if(ImGui::TreeNode(mName.data())){ - bool treeOpen = ImGui::TreeNode("Objects"); - ImGui::SameLine(); - ImGui::Text(ICON_FK_PLUS_CIRCLE); - if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){ - auto object = std::make_shared(); - AddChild(object); - selected = object; - } - if(treeOpen){ for (auto node : GetChildrenOfType(EDOMNodeType::Object)){ node->RenderHeirarchyUI(selected); } + ImGui::Text(ICON_FK_PLUS_CIRCLE); + if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){ + auto object = std::make_shared(); + AddChild(object); + selected = object; + } ImGui::TreePop(); } treeOpen = ImGui::TreeNode("Area Objects"); - ImGui::SameLine(); - ImGui::Text(ICON_FK_PLUS_CIRCLE); - if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){ - auto object = std::make_shared(); - AddChild(object); - selected = object; - } if(treeOpen){ for (auto node : GetChildrenOfType(EDOMNodeType::AreaObject)){ node->RenderHeirarchyUI(selected); } - ImGui::TreePop(); + ImGui::Text(ICON_FK_PLUS_CIRCLE); + if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){ + auto object = std::make_shared(); + AddChild(object); + selected = object; + } + ImGui::TreePop(); } ImGui::TreePop();