diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/class_db.cpp | 5 | ||||
-rw-r--r-- | core/class_db.h | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/class_db.cpp b/core/class_db.cpp index 34bc83c89a..9fe9b23c68 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -1397,7 +1397,7 @@ void ClassDB::get_extensions_for_type(const StringName &p_class, List<String> *p HashMap<StringName, HashMap<StringName, Variant> > ClassDB::default_values; Set<StringName> ClassDB::default_values_cached; -Variant ClassDB::class_get_default_property_value(const StringName &p_class, const StringName &p_property) { +Variant ClassDB::class_get_default_property_value(const StringName &p_class, const StringName &p_property, bool *r_valid) { if (!default_values_cached.has(p_class)) { @@ -1439,13 +1439,16 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con } if (!default_values.has(p_class)) { + if (r_valid != NULL) *r_valid = false; return Variant(); } if (!default_values[p_class].has(p_property)) { + if (r_valid != NULL) *r_valid = false; return Variant(); } + if (r_valid != NULL) *r_valid = true; return default_values[p_class][p_property]; } diff --git a/core/class_db.h b/core/class_db.h index 8adbc9ba98..237ae9b806 100644 --- a/core/class_db.h +++ b/core/class_db.h @@ -357,7 +357,7 @@ public: static void get_enum_list(const StringName &p_class, List<StringName> *p_enums, bool p_no_inheritance = false); static void get_enum_constants(const StringName &p_class, const StringName &p_enum, List<StringName> *p_constants, bool p_no_inheritance = false); - static Variant class_get_default_property_value(const StringName &p_class, const StringName &p_property); + static Variant class_get_default_property_value(const StringName &p_class, const StringName &p_property, bool *r_valid = NULL); static StringName get_category(const StringName &p_node); |