From 636736f5672fe7beaca7d2878e29376fcd02f2b1 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Sun, 1 Sep 2024 23:50:00 -0400 Subject: [PATCH] Fixed a bug where bsp wouldnt get serialized properly + displaying brush in darker in scene hierarchy --- Editor/src/Windows/EditorInterface.cpp | 7 ++++++- Nuake/src/Scene/Components/BSPBrushComponent.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 152c946d..eaf1af3e 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -55,6 +55,7 @@ #include "../Commands/Commands/Commands.h" #include #include "../ScriptingContext/ScriptingContext.h" +#include namespace Nuake { @@ -746,6 +747,10 @@ namespace Nuake { { ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255)); } + else if (e.HasComponent()) + { + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 255, 255, 120)); + } if (!m_IsRenaming && m_ShouldUnfoldEntityTree && Selection.Type == EditorSelectionType::Entity && e.GetScene()->EntityIsParent(Selection.Entity, e)) { @@ -775,7 +780,7 @@ namespace Nuake { } bool isDragging = false; - if (nameComponent.IsPrefab && e.HasComponent()) + if (nameComponent.IsPrefab && e.HasComponent() || e.HasComponent()) { ImGui::PopStyleColor(); } diff --git a/Nuake/src/Scene/Components/BSPBrushComponent.h b/Nuake/src/Scene/Components/BSPBrushComponent.h index 7c5ba3b0..b4ba41cc 100644 --- a/Nuake/src/Scene/Components/BSPBrushComponent.h +++ b/Nuake/src/Scene/Components/BSPBrushComponent.h @@ -55,6 +55,7 @@ namespace Nuake { SERIALIZE_VAL(TargetName); j["IsSolid"] = IsSolid; SERIALIZE_VAL(IsTrigger); + SERIALIZE_VAL(IsFunc); END_SERIALIZE(); } @@ -84,6 +85,7 @@ namespace Nuake { DESERIALIZE_VAL(target); DESERIALIZE_VAL(TargetName); + DESERIALIZE_VAL(IsFunc); DESERIALIZE_VAL(IsTrigger); return true; }