summaryrefslogtreecommitdiffstats
path: root/test/src/example.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-09-13 13:44:22 +0200
committerGitHub <noreply@github.com>2023-09-13 13:44:22 +0200
commit6caf4909d42c04de25d9c34e89da7aa078fb485f (patch)
tree8d17c3d87f6ea3b0c5a9f3426d691c073d5947ee /test/src/example.cpp
parent16ffb2795ae804cee84cc9939d542e4ffa9290db (diff)
parentaa6867e6c95e80e003be38037d7149e6648ed32d (diff)
downloadredot-cpp-6caf4909d42c04de25d9c34e89da7aa078fb485f.tar.gz
Merge pull request #1239 from dsnopek/gdextension-validate-property-object
Support `_validate_property()`
Diffstat (limited to 'test/src/example.cpp')
-rw-r--r--test/src/example.cpp8
1 files changed, 8 insertions, 0 deletions
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);