diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-20 18:58:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-21 14:25:29 +0100 |
commit | 3c0059650da3f1feb3c95364d571fe706826dec6 (patch) | |
tree | a36ba94f313e2dee88dc2eb253175849fb2d4138 /core/io/resource_format_binary.cpp | |
parent | 7ac0973e9abb308b91597dd8881aeed62682733c (diff) | |
download | redot-engine-3c0059650da3f1feb3c95364d571fe706826dec6.tar.gz |
Added StringName as a variant type.
Also changed all relevant properties defined manually to StringName.
Diffstat (limited to 'core/io/resource_format_binary.cpp')
-rw-r--r-- | core/io/resource_format_binary.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 991853e86d..144e48d0da 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -75,6 +75,7 @@ enum { VARIANT_DOUBLE = 41, VARIANT_CALLABLE = 42, VARIANT_SIGNAL = 43, + VARIANT_STRING_NAME = 44, OBJECT_EMPTY = 0, OBJECT_EXTERNAL_RESOURCE = 1, OBJECT_INTERNAL_RESOURCE = 2, @@ -260,6 +261,10 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { r_v = v; } break; + case VARIANT_STRING_NAME: { + + r_v = StringName(get_unicode_string()); + } break; case VARIANT_NODE_PATH: { @@ -1394,6 +1399,13 @@ void ResourceFormatSaverBinaryInstance::write_variant(FileAccess *f, const Varia f->store_real(val.a); } break; + case Variant::STRING_NAME: { + + f->store_32(VARIANT_STRING_NAME); + String val = p_property; + save_unicode_string(f, val); + + } break; case Variant::NODE_PATH: { f->store_32(VARIANT_NODE_PATH); |