From a9961b378a5ad79d410be6f5a05efb33c105293d Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Tue, 29 Nov 2022 18:55:26 +0300 Subject: [PATCH] Add missing public property_*_revert getters --- core/object/object.cpp | 2 ++ doc/classes/Object.xml | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/core/object/object.cpp b/core/object/object.cpp index d27e0d76214..105f9560d6a 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1473,6 +1473,8 @@ void Object::_bind_methods() { ClassDB::bind_method(D_METHOD("get_indexed", "property_path"), &Object::_get_indexed_bind); ClassDB::bind_method(D_METHOD("get_property_list"), &Object::_get_property_list_bind); ClassDB::bind_method(D_METHOD("get_method_list"), &Object::_get_method_list_bind); + ClassDB::bind_method(D_METHOD("property_can_revert", "property"), &Object::property_can_revert); + ClassDB::bind_method(D_METHOD("property_get_revert", "property"), &Object::property_get_revert); ClassDB::bind_method(D_METHOD("notification", "what", "reversed"), &Object::notification, DEFVAL(false)); ClassDB::bind_method(D_METHOD("to_string"), &Object::to_string); ClassDB::bind_method(D_METHOD("get_instance_id"), &Object::get_instance_id); diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index bf15f96291b..5e834b3d91e 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -764,6 +764,22 @@ Emits the [signal property_list_changed] signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated. + + + + + Returns [code]true[/code] if the given [param property] has a custom default value. Use [method property_get_revert] to get the [param property]'s default value. + [b]Note:[/b] This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_can_revert] to customize the default value. If [method _property_can_revert] is not implemented, this method returns [code]false[/code]. + + + + + + + Returns the custom default value of the given [param property]. Use [method property_can_revert] to check if the [param property] has a custom default value. + [b]Note:[/b] This method is used by the Inspector dock to display a revert icon. The object must implement [method _property_get_revert] to customize the default value. If [method _property_get_revert] is not implemented, this method returns [code]null[/code]. + +