From aa6867e6c95e80e003be38037d7149e6648ed32d Mon Sep 17 00:00:00 2001 From: David Snopek Date: Sat, 9 Sep 2023 12:52:31 -0500 Subject: Support `_validate_property()` --- test/src/example.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/src/example.cpp') diff --git a/test/src/example.cpp b/test/src/example.cpp index 8a761a4..dc471dd 100644 --- a/test/src/example.cpp +++ b/test/src/example.cpp @@ -117,6 +117,14 @@ bool Example::_property_get_revert(const StringName &p_name, Variant &r_property } }; +void Example::_validate_property(PropertyInfo &p_property) const { + String name = p_property.name; + // Test hiding the "mouse_filter" property from the editor. + if (name == "mouse_filter") { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } +} + void Example::_bind_methods() { // Methods. ClassDB::bind_method(D_METHOD("simple_func"), &Example::simple_func); -- cgit v1.2.3