mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

* Also make the update real time (any change in the settings are shown directly in the editor) Don't show the rest in the changelog: * Add various Flow typings where missing (SetupGridDialog and various InstancesEditor files) * Serialize the settings into a generic "EditorSetting" (so that the Project is agnostic of any editor related stuff) * Rename uiSettings/options/LayoutEditorCanvasOptions to InstancesEditorSettings * Handle everything inside the IDE (so that the Project remains agnostic of any editor related stuff) Note that in the future, this kind of EditorSetting that is stored inside the project could be moved to its own structure (living outside of the project file).
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/EditorSettings.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)
|
|
editorSettings.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"));
|
|
editorSettings.SerializeTo(element.AddChild("editionSettings"));
|
|
element.SetAttribute("associatedLayout", associatedLayout);
|
|
}
|
|
#endif
|
|
|
|
} // namespace gd
|