Stopped display child of prefabs

This commit is contained in:
antopilo
2024-09-21 12:58:01 -04:00
parent 954e2110f1
commit 0c784d4462

View File

@@ -856,6 +856,7 @@ namespace Nuake {
}
bool isDragging = false;
bool isPrefab = e.HasComponent<PrefabComponent>();
if (nameComponent.IsPrefab && e.HasComponent<PrefabComponent>() || e.HasComponent<BSPBrushComponent>())
{
ImGui::PopStyleColor();
@@ -867,7 +868,7 @@ namespace Nuake {
ImGui::EndDragDropSource();
}
if (ImGui::BeginDragDropTarget())
if (!isPrefab && ImGui::BeginDragDropTarget())
{
if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("ENTITY"))
{
@@ -907,7 +908,6 @@ namespace Nuake {
}
ImGui::EndDragDropTarget();
}
if (!isDragging && ImGui::IsItemHovered() && ImGui::IsMouseReleased(0))
{
@@ -964,7 +964,7 @@ namespace Nuake {
}
}
if (ImGui::Selectable("Save entity as a new prefab"))
if (!isPrefab && ImGui::Selectable("Save entity as a new prefab"))
{
Ref<Prefab> newPrefab = Prefab::CreatePrefabFromEntity(Selection.Entity);
std::string savePath = FileDialog::SaveFile("*.prefab");
@@ -1019,7 +1019,7 @@ namespace Nuake {
ImGui::PopStyleColor();
}
if (open)
if (!isPrefab && open)
{
// Caching list to prevent deletion while iterating.
std::vector<Entity> childrens = parent.Children;
@@ -3430,6 +3430,7 @@ namespace Nuake {
if (entity.HasComponent<PrefabComponent>())
{
entityTypeName = "Prefab";
return entityTypeName;
}
if (entity.HasComponent<AudioEmitterComponent>())