mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-23 10:35:35 -04:00
a8559bfbbc
* Update all CMakeLists of extensions to use clang-format * Run clang-format on all Extensions * Update GDCore CMakeLists.txt to add clang-format * Run clang-format on GDCore files * Update GDJS and GDCpp CMakeLists.txt to add clang-format * Run clang-format on GDCpp and GDJS files
34 lines
1.2 KiB
C++
34 lines
1.2 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/LayoutEditorCanvasOptions.h"
|
|
#include "GDCore/Project/InitialInstancesContainer.h"
|
|
#include "GDCore/Serialization/SerializerElement.h"
|
|
#include "GDCore/TinyXml/tinyxml.h"
|
|
|
|
namespace gd {
|
|
|
|
void ExternalLayout::UnserializeFrom(const SerializerElement& element) {
|
|
name = element.GetStringAttribute("name", "", "Name");
|
|
instances.UnserializeFrom(element.GetChild("instances", 0, "Instances"));
|
|
#if defined(GD_IDE_ONLY)
|
|
editionSettings.UnserializeFrom(element.GetChild("editionSettings"));
|
|
#endif
|
|
associatedLayout = element.GetStringAttribute("associatedLayout");
|
|
}
|
|
|
|
#if defined(GD_IDE_ONLY)
|
|
void ExternalLayout::SerializeTo(SerializerElement& element) const {
|
|
element.SetAttribute("name", name);
|
|
instances.SerializeTo(element.AddChild("instances"));
|
|
editionSettings.SerializeTo(element.AddChild("editionSettings"));
|
|
element.SetAttribute("associatedLayout", associatedLayout);
|
|
}
|
|
#endif
|
|
|
|
} // namespace gd
|