Files
GDevelop/Core/GDCore/Project/ExternalLayout.cpp
T
D8H deb802cfec Allow to override behavior properties on object instances (#8171)
* For now, this is limited to instances inside custom objects. This will be made available in the future for all instances in scenes if this works well.
2026-02-09 16:21:24 +01:00

31 lines
1.1 KiB
C++

/*
* GDevelop Core
* Copyright 2008-2016 Florian Rival (Florian.Rival@gmail.com). All rights
* reserved. This project is released under the MIT License.
*/
#include "GDCore/Project/ExternalLayout.h"
#include "GDCore/IDE/Dialogs/LayoutEditorCanvas/EditorSettings.h"
#include "GDCore/Project/InitialInstancesContainer.h"
#include "GDCore/Serialization/SerializerElement.h"
namespace gd {
void ExternalLayout::UnserializeFrom(gd::Project &project,
const SerializerElement &element) {
name = element.GetStringAttribute("name", "", "Name");
instances.UnserializeFrom(project, element.GetChild("instances", 0, "Instances"));
editorSettings.UnserializeFrom(element.GetChild("editionSettings"));
associatedLayout = element.GetStringAttribute("associatedLayout");
}
void ExternalLayout::SerializeTo(SerializerElement& element) const {
element.SetAttribute("name", name);
instances.SerializeTo(element.AddChild("instances"));
editorSettings.SerializeTo(element.AddChild("editionSettings"));
element.SetAttribute("associatedLayout", associatedLayout);
}
} // namespace gd