From da066abe58112391b176800ae7f55e87b3cb0279 Mon Sep 17 00:00:00 2001 From: JostMK Date: Wed, 21 Feb 2024 00:25:17 +0100 Subject: [PATCH] [doc] Add explanation for property check --- addons/hide_private_properties/inspector_plugin.gd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/hide_private_properties/inspector_plugin.gd b/addons/hide_private_properties/inspector_plugin.gd index 96fbd56..fe4f189 100644 --- a/addons/hide_private_properties/inspector_plugin.gd +++ b/addons/hide_private_properties/inspector_plugin.gd @@ -1,6 +1,8 @@ extends EditorInspectorPlugin func _can_handle(object: Object) -> bool: + # Early return if property does not exist, prevents triggering a warning for + # some objects that overwrite the 'get' method. if not _has_property(object, "scene_file_path"): return false @@ -13,6 +15,8 @@ func _parse_property(object: Object, type: Variant.Type, name: String, hint_type return false func _has_property(object: Object, propertyName: String) -> bool: + # Note: Checking if the property exists using the 'in' keyword also triggers + # the warning in 'core/config/project_settings.cpp:_get' (v4.2.1) for property in object.get_property_list(): if property.name == propertyName: return true