Skip to content
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

Add an editor_description property to Node for documentation purposes #31389

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Aug 15, 2019

It is implemented using editor-only metadata, in a way similar to edit locking or Position2D gizmo extents.

This closes #2082.

Caveats

Preview

Edition in the inspector

node_comment_inspector

Display in a tooltip in the scene tree dock

node_comment_tooltip

@bojidar-bg
Copy link
Contributor

Can/should this be added to the Node's metadata instead?

@Calinou
Copy link
Member Author

Calinou commented Aug 15, 2019

@bojidar-bg The comment property only sets/gets metadata, it doesn't actually store the value in the property, just like in #28390.

It could be made into a metadata-only value (without an associated comment property). In this case, we'd need to expose it in the Inspector somehow (or somewhere else). This would have the upside of not having to break compatibility 🙂

@akien-mga
Copy link
Member

GraphNode's comment property was renamed to comment_node to avoid naming conflicts.

Should it be named description so that it doesn't need to break compat?

@akien-mga akien-mga added this to the 3.2 milestone Aug 15, 2019
@bojidar-bg
Copy link
Contributor

Or editor_comment, or editor_description, so it clear that the property is editor-only.

@Xrayez
Copy link
Contributor

Xrayez commented Aug 16, 2019

Should it be named description so that it doesn't need to break compat?

Just added this for one of my custom resource node recently. 😃

@Xrayez
Copy link
Contributor

Xrayez commented Aug 16, 2019

It could be made into a metadata-only value (without an associated comment property). In this case, we'd need to expose it in the Inspector somehow (or somewhere else). This would have the upside of not having to break compatibility 🙂

I've made some table UI with which you can pass an array of properties to be displayed for each column in the table, rows being the actual nodes/objects etc. So having a comment or description property (not metadata) would allow me to generalize this down to using get_property_list, so my concern is whether this method could actually return metadata for object or whether I'd to have add an additional check just for this manually. An example of how I'm using this:

var objects = [...]
table.create_from_data(objects, ['description', 'count', 'enabled', ...])

@akien-mga
Copy link
Member

Or editor_comment, or editor_description, so it clear that the property is editor-only.

So should we go with editor_description?

It is implemented using editor-only metadata, in a way similar to
edit locking or Position2D gizmo extents.

This closes godotengine#2082.
@Calinou Calinou force-pushed the add-node-comments branch from 8dfe2d7 to 9eb10f1 Compare August 23, 2019 13:59
@Calinou Calinou changed the title Add a comment property to Node for documentation purposes Add an editor_description property to Node for documentation purposes Aug 23, 2019
@Calinou
Copy link
Member Author

Calinou commented Aug 23, 2019

@akien-mga Done 🙂 This PR should no longer break compatibility now.

@akien-mga akien-mga merged commit 4dfea5f into godotengine:master Sep 3, 2019
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attach a note/comment to a node
4 participants