Ability to convert native engine types to JSON and back.

Implements support for all engine types in JSON encoding/decoding

Co-Authored-By: Juan <reduzio@gmail.com>
Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
K. S. Ernest (iFire) Lee
2024-06-01 10:40:37 -07:00
parent 5ca419e32c
commit 71bdbcdfb1
5 changed files with 931 additions and 1 deletions

View File

@@ -38,6 +38,16 @@
<tutorials>
</tutorials>
<methods>
<method name="from_native" qualifiers="static">
<return type="Variant" />
<param index="0" name="variant" type="Variant" />
<param index="1" name="allow_classes" type="bool" default="false" />
<param index="2" name="allow_scripts" type="bool" default="false" />
<description>
Converts a native engine type to a JSON-compliant dictionary.
By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified.
</description>
</method>
<method name="get_error_line" qualifiers="const">
<return type="int" />
<description>
@@ -124,6 +134,16 @@
[/codeblock]
</description>
</method>
<method name="to_native" qualifiers="static">
<return type="Variant" />
<param index="0" name="json" type="Variant" />
<param index="1" name="allow_classes" type="bool" default="false" />
<param index="2" name="allow_scripts" type="bool" default="false" />
<description>
Converts a JSON-compliant dictionary that was created with [method from_native] back to native engine types.
By default, classes and scripts are ignored for security reasons, unless [param allow_classes] or [param allow_scripts] are specified.
</description>
</method>
</methods>
<members>
<member name="data" type="Variant" setter="set_data" getter="get_data" default="null">