From db71f4d61cf9dfb7f10a063e3036aca2d9185209 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Wed, 6 Dec 2023 16:41:05 +0100 Subject: [PATCH] [#163]: Fix remaining issues with list of Objects in Editor --- editor/editor.cpp | 1 + editor/gui/editor_gui.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/editor.cpp b/editor/editor.cpp index 5dffc483..d30e5337 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -901,6 +901,7 @@ Editor::CopyGameObject(const std::shared_ptr< GameObject >& objectToCopy) newObject->GetSprite().SetTextureFromFile(objectToCopy->GetSprite().GetTextureName()); HandleGameObjectSelected(newObject); + gui_.ObjectUpdated(newObject->GetID()); } void diff --git a/editor/gui/editor_gui.cpp b/editor/gui/editor_gui.cpp index 7b8f6d53..01d93c00 100644 --- a/editor/gui/editor_gui.cpp +++ b/editor/gui/editor_gui.cpp @@ -1234,7 +1234,8 @@ EditorGUI::ObjectUpdated(Object::ID ID) switch (object.GetType()) { case ObjectType::ENEMY: - case ObjectType::PLAYER: { + case ObjectType::PLAYER: + case ObjectType::OBJECT: { const auto& gameObject = static_cast< const GameObject& >(object); objectLabels_[ID] = fmt::format( @@ -1245,8 +1246,7 @@ EditorGUI::ObjectUpdated(Object::ID ID) case ObjectType::ANIMATION_POINT: case ObjectType::NONE: - case ObjectType::PATHFINDER_NODE: - case ObjectType::OBJECT: { + case ObjectType::PATHFINDER_NODE: { // We don't care } }