From 15f698467514bdf1e352433e8e3b60eb3b912357 Mon Sep 17 00:00:00 2001 From: Sai Nane Date: Fri, 9 Aug 2024 19:06:34 +0000 Subject: [PATCH] Fix check in `Object._ValidateProperty` example The GDScript version above makes the `number` property read only whenever `is_number_editable` is false. ```gdscript func _validate_property(property: Dictionary): if property.name == "number" and not is_number_editable: property.usage |= PROPERTY_USAGE_READ_ONLY ``` The C# version is similar, but omits the negation, so the Number property is made read only whenever `is_number_editable` is true. This adds the negation to the C# example, making it match the GDScript example. --- doc/classes/Object.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index eecb3ca525f..ed420f4587d 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -341,7 +341,7 @@ public override void _ValidateProperty(Godot.Collections.Dictionary property) { - if (property["name"].AsStringName() == PropertyName.Number && IsNumberEditable) + if (property["name"].AsStringName() == PropertyName.Number && !IsNumberEditable) { var usage = property["usage"].As<PropertyUsageFlags>() | PropertyUsageFlags.ReadOnly; property["usage"] = (int)usage;