From 91624a7561de835d25995cfd72c320d5c15fdfd6 Mon Sep 17 00:00:00 2001 From: Jordan Schidlowsky Date: Thu, 13 Oct 2022 11:15:45 -0600 Subject: [PATCH] expose additional global enums in 3.x which are available in master --- core/global_constants.cpp | 15 ++++++++++++++ doc/classes/@GlobalScope.xml | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 2bb160976..886f31590 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -613,7 +613,22 @@ void register_global_constants() { BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_COLOR_NO_ALPHA); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSY); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_ID); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_TYPE_STRING); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_VARIANT_TYPE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_BASE_TYPE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_INSTANCE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_METHOD_OF_SCRIPT); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_BASE_TYPE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_INSTANCE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_PROPERTY_OF_SCRIPT); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_OBJECT_TOO_BIG); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_NODE_PATH_VALID_TYPES); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_SAVE_FILE); + BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_HINT_MAX); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_STORAGE); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR); BIND_GLOBAL_ENUM_CONSTANT(PROPERTY_USAGE_NETWORK); diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index c7f0727d0..c16d37c9d 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1511,6 +1511,44 @@ Hints that an image is compressed using lossless compression. + + + + Hint that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. For instance: + [codeblock] + hint_string = "%s:" % [TYPE_INT] # Array of inteters. + hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats. + hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources. + hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources. + [/codeblock] + [b]Note:[/b] The final colon is required to specify for properly detecting built-in types. + + + + + + + + + + + + + + + + + + + + + + + + + + + The property is serialized and saved in the scene file (default).