You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Expose ClassDB::class_get_property_default_value method
This commit is contained in:
@@ -1439,6 +1439,15 @@ Error ClassDB::class_set_property(Object *p_object, const StringName &p_property
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Variant ClassDB::class_get_property_default_value(const StringName &p_class, const StringName &p_property) const {
|
||||||
|
bool valid;
|
||||||
|
Variant ret = ::ClassDB::class_get_default_property_value(p_class, p_property, &valid);
|
||||||
|
if (valid) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return Variant();
|
||||||
|
}
|
||||||
|
|
||||||
bool ClassDB::class_has_method(const StringName &p_class, const StringName &p_method, bool p_no_inheritance) const {
|
bool ClassDB::class_has_method(const StringName &p_class, const StringName &p_method, bool p_no_inheritance) const {
|
||||||
return ::ClassDB::has_method(p_class, p_method, p_no_inheritance);
|
return ::ClassDB::has_method(p_class, p_method, p_no_inheritance);
|
||||||
}
|
}
|
||||||
@@ -1573,6 +1582,8 @@ void ClassDB::_bind_methods() {
|
|||||||
::ClassDB::bind_method(D_METHOD("class_get_property", "object", "property"), &ClassDB::class_get_property);
|
::ClassDB::bind_method(D_METHOD("class_get_property", "object", "property"), &ClassDB::class_get_property);
|
||||||
::ClassDB::bind_method(D_METHOD("class_set_property", "object", "property", "value"), &ClassDB::class_set_property);
|
::ClassDB::bind_method(D_METHOD("class_set_property", "object", "property", "value"), &ClassDB::class_set_property);
|
||||||
|
|
||||||
|
::ClassDB::bind_method(D_METHOD("class_get_property_default_value", "class", "property"), &ClassDB::class_get_property_default_value);
|
||||||
|
|
||||||
::ClassDB::bind_method(D_METHOD("class_has_method", "class", "method", "no_inheritance"), &ClassDB::class_has_method, DEFVAL(false));
|
::ClassDB::bind_method(D_METHOD("class_has_method", "class", "method", "no_inheritance"), &ClassDB::class_has_method, DEFVAL(false));
|
||||||
|
|
||||||
::ClassDB::bind_method(D_METHOD("class_get_method_argument_count", "class", "method", "no_inheritance"), &ClassDB::class_get_method_argument_count, DEFVAL(false));
|
::ClassDB::bind_method(D_METHOD("class_get_method_argument_count", "class", "method", "no_inheritance"), &ClassDB::class_get_method_argument_count, DEFVAL(false));
|
||||||
|
|||||||
@@ -446,6 +446,8 @@ public:
|
|||||||
Variant class_get_property(Object *p_object, const StringName &p_property) const;
|
Variant class_get_property(Object *p_object, const StringName &p_property) const;
|
||||||
Error class_set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const;
|
Error class_set_property(Object *p_object, const StringName &p_property, const Variant &p_value) const;
|
||||||
|
|
||||||
|
Variant class_get_property_default_value(const StringName &p_class, const StringName &p_property) const;
|
||||||
|
|
||||||
bool class_has_method(const StringName &p_class, const StringName &p_method, bool p_no_inheritance = false) const;
|
bool class_has_method(const StringName &p_class, const StringName &p_method, bool p_no_inheritance = false) const;
|
||||||
|
|
||||||
int class_get_method_argument_count(const StringName &p_class, const StringName &p_method, bool p_no_inheritance = false) const;
|
int class_get_method_argument_count(const StringName &p_class, const StringName &p_method, bool p_no_inheritance = false) const;
|
||||||
|
|||||||
@@ -91,6 +91,14 @@
|
|||||||
Returns the value of [param property] of [param object] or its ancestry.
|
Returns the value of [param property] of [param object] or its ancestry.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="class_get_property_default_value" qualifiers="const">
|
||||||
|
<return type="Variant" />
|
||||||
|
<param index="0" name="class" type="StringName" />
|
||||||
|
<param index="1" name="property" type="StringName" />
|
||||||
|
<description>
|
||||||
|
Returns the default value of [param property] of [param class] or its ancestor classes.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="class_get_property_list" qualifiers="const">
|
<method name="class_get_property_list" qualifiers="const">
|
||||||
<return type="Dictionary[]" />
|
<return type="Dictionary[]" />
|
||||||
<param index="0" name="class" type="StringName" />
|
<param index="0" name="class" type="StringName" />
|
||||||
|
|||||||
Reference in New Issue
Block a user