summaryrefslogtreecommitdiff
path: root/core/object
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-22 16:10:41 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-24 14:06:00 +0100
commit5d20dccade7dee6fa2de8147f407818cdfaa0955 (patch)
treedbde6d289bc04018b42904a53da4878c9f0fd572 /core/object
parentf6f8a48459f9bbe97ee76a7186b9ae37e71e724b (diff)
Add MAKE_RESOURCE_TYPE_HINT macro to simplify binding arrays of resources
Diffstat (limited to 'core/object')
-rw-r--r--core/object/object.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/object/object.h b/core/object/object.h
index 16ad7b8832..9416eb7762 100644
--- a/core/object/object.h
+++ b/core/object/object.h
@@ -149,6 +149,10 @@ enum PropertyUsageFlags {
#define ADD_ARRAY_COUNT_WITH_USAGE_FLAGS(m_label, m_count_property, m_count_property_setter, m_count_property_getter, m_prefix, m_property_usage_flags) ClassDB::add_property_array_count(get_class_static(), m_label, m_count_property, _scs_create(m_count_property_setter), _scs_create(m_count_property_getter), m_prefix, m_property_usage_flags)
#define ADD_ARRAY(m_array_path, m_prefix) ClassDB::add_property_array(get_class_static(), m_array_path, m_prefix)
+// Helper macro to use with PROPERTY_HINT_ARRAY_TYPE for arrays of specific resources:
+// PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, MAKE_RESOURCE_TYPE_HINT("Font")
+#define MAKE_RESOURCE_TYPE_HINT(m_type) vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, m_type)
+
struct PropertyInfo {
Variant::Type type = Variant::NIL;
String name;