Skip to content

Commit

Permalink
move add object button to bottom of layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Astral-C committed Oct 29, 2023
1 parent 4a9c1c8 commit 60b0f15
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/DOM/ZoneDOMNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,38 +109,34 @@ void SZoneLayerDOMNode::RenderHeirarchyUI(std::shared_ptr<SDOMNodeBase>& 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<SObjectDOMNode>();
AddChild(object);
selected = object;
}

if(treeOpen){
for (auto node : GetChildrenOfType<SObjectDOMNode>(EDOMNodeType::Object)){
node->RenderHeirarchyUI(selected);
}
ImGui::Text(ICON_FK_PLUS_CIRCLE);
if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){
auto object = std::make_shared<SObjectDOMNode>();
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<SAreaObjectDOMNode>();
AddChild(object);
selected = object;
}

if(treeOpen){
for (auto node : GetChildrenOfType<SAreaObjectDOMNode>(EDOMNodeType::AreaObject)){
node->RenderHeirarchyUI(selected);
}

ImGui::TreePop();
ImGui::Text(ICON_FK_PLUS_CIRCLE);
if(ImGui::IsItemClicked(ImGuiMouseButton_Left)){
auto object = std::make_shared<SAreaObjectDOMNode>();
AddChild(object);
selected = object;
}
ImGui::TreePop();
}

ImGui::TreePop();
Expand Down

0 comments on commit 60b0f15

Please sign in to comment.