-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Object.get_property_list()
method description
#81093
Improve Object.get_property_list()
method description
#81093
Conversation
This is not correct in general, for example in GDScript var a: int
@export var b: int
func _ready() -> void:
for p in get_property_list():
print(p)
I think it should be a note at the end of the method description explicitly mentioning C#. @mateuseap Please update also the commit message. |
Object.get_method_list
method descriptionObject.get_property_list()
method description
51053e3
to
b5a4bef
Compare
@dalexeev thanks for helping me! I removed my previous modifications, added a note in the end of |
I'm not sure what the added note is saying, and so I feel that it's wrong. It is true that while in GDScript all class members would be properties, in C# properties need to be explicitly opted in. But I'm not confident the added note helps. The list of properties is not related to scripting languages. It's an overall engine concept. Built-in objects also contain properties and this method returns all of them. Properties can be added dynamically by overriding I think that the note could simply state that C# and 3rd party languages may require you to explicitly mark class members as Godot properties. |
b5a4bef
to
4494743
Compare
@YuriSizov done! I still mantained the statement that says that in GDScript all class members are treated as properties, but I've clarified that C# and 3rd party languages may require you to explicitly mark class members as Godot properties, as you've pointed out. |
d204462
to
367c515
Compare
doc/classes/Object.xml
Outdated
@@ -651,6 +651,7 @@ | |||
- [code]hint[/code] is [i]how[/i] the property is meant to be edited (see [enum PropertyHint]); | |||
- [code]hint_string[/code] depends on the hint (see [enum PropertyHint]); | |||
- [code]usage[/code] is a combination of [enum PropertyUsageFlags]. | |||
[b]Note:[/b] While in GDScript all class members are treated as properties, in C# and some 3rd party languages may be necessary to explicitly mark class members as Godot properties using decorators or attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[b]Note:[/b] While in GDScript all class members are treated as properties, in C# and some 3rd party languages may be necessary to explicitly mark class members as Godot properties using decorators or attributes. | |
[b]Note:[/b] In GDScript, all class members are treated as properties. In C# and GDExtension, it may be necessary to explicitly mark class members as Godot properties using decorators or attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we clarify "member variables" to avoid any confusion?
d87dc95
to
6020e34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now!
Thanks! |
What I did
Object.get_property_list()
method description by making more clear what are the properties returned.Bugsquad edit: Fixed method name and formatting.