Add content deprecation system that auto-saves assets in Editor that use old data format

This commit is contained in:
Wojtek Figat
2025-01-20 23:46:49 +01:00
parent 1497acef58
commit 8a7ceef288
67 changed files with 751 additions and 427 deletions

View File

@@ -246,7 +246,7 @@ public:
/// Tries to load surface graph from the asset.
/// </summary>
/// <returns>The surface data or empty if failed to load it.</returns>
API_FUNCTION() BytesContainer LoadSurface();
API_FUNCTION() BytesContainer LoadSurface() const;
#if USE_EDITOR
@@ -256,7 +256,7 @@ public:
/// <param name="data">Stream with graph data.</param>
/// <param name="meta">Script metadata.</param>
/// <returns>True if cannot save it, otherwise false.</returns>
API_FUNCTION() bool SaveSurface(const BytesContainer& data, API_PARAM(Ref) const Metadata& meta);
API_FUNCTION() bool SaveSurface(const BytesContainer& data, API_PARAM(Ref) const Metadata& meta) const;
// Returns the amount of methods in the script.
API_FUNCTION() int32 GetMethodsCount() const
@@ -286,6 +286,7 @@ public:
BinaryAsset::GetReferences(assets, files);
Graph.GetReferences(assets);
}
bool Save(const StringView& path = StringView::Empty) override;
#endif
protected:
@@ -406,7 +407,6 @@ public:
static Variant Invoke(VisualScript::Method* method, ScriptingObject* instance, Span<Variant> parameters = Span<Variant>());
#if VISUAL_SCRIPT_DEBUGGING
// Custom event that is called every time the Visual Script signal flows over the graph (including the data connections). Can be used to read nad visualize the Visual Script execution logic.
static Action DebugFlow;
@@ -420,6 +420,5 @@ public:
/// <param name="result">The output value. Valid only if method returned true.</param>
/// <returns>True if could fetch the value, otherwise false.</returns>
static bool Evaluate(VisualScript* script, ScriptingObject* instance, uint32 nodeId, uint32 boxId, Variant& result);
#endif
};