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

Allow copy-pasting node property names in the inspector #655

Closed
rezgi opened this issue Mar 31, 2020 · 8 comments
Closed

Allow copy-pasting node property names in the inspector #655

rezgi opened this issue Mar 31, 2020 · 8 comments
Milestone

Comments

@rezgi
Copy link

rezgi commented Mar 31, 2020

Describe the project you are working on:
Making a UI for my game and I wanted to change the font color of my label on a certain event.

Describe the problem or limitation you are having in your project:
To change a property within my code, I hover on the said property shown in the inspector, then have to remember it and write it in my code. My brain is the limitation here.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
I propose to be able to right-click on any inspector property to copy its code equivalent in order to quickly use it in code.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
If I want to change dynamically a label font color for example : Select the Label node > Go to Control / Custom Colors / Font Color. On hover the info tip shows the code property custom_colors/font_color. Then I right-click on the property and select 'Copy property code' or something like that. Now I can juste paste it in my code !

If this enhancement will not be used often, can it be worked around with a few lines of script?:
Yeah no big deal, just use our code-overloaded brain to remember one more information :)

Is there a reason why this should be core and not an add-on in the asset library?:
It's a quality-of-life improvement, saves you milliseconds ! It has no price.

@Calinou
Copy link
Member

Calinou commented Mar 31, 2020

If I want to change dynamically a label font color for example : Select the Label node > Go to Control / Custom Colors / Font Color. On hover the info tip shows the code property custom_colors/font_color. Then I right-click on the property and select 'Copy property code' or something like that. Now I can juste paste it in my code !

Actually, that one is a special case. This is a Control "custom color", not a node property. This means you have to set it using add_color_override("font_color", some_color). Same goes for properties that appear as "Custom Styles", "Custom Constants", "Custom Shaders", "Custom Icons" and so on.

@rezgi
Copy link
Author

rezgi commented Mar 31, 2020

Yeah I know but I was submitting the idea for all properties in all nodes, but I guess that it's a bit redundant to copy visible just for 'Visible' or modulate for 'Modulate'. So maybe this proposal isn't really useful for most cases. Should I close the proposal ?

@Calinou
Copy link
Member

Calinou commented Mar 31, 2020

Should I close the proposal ?

No, I definitely think it's useful. We just need to figure out how to add a context menu to EditorInspector.

@rezgi
Copy link
Author

rezgi commented Apr 1, 2020

Ok. In this case, adding a context menu could open many more possibilities, not only to copy property code. Another way of using this feature is by having a quick-find menu like in other IDEs (search for a property keyword and having its doc link as well as an option to copy the code equivalent), but I guess it has already been proposed in some other thread ?

@Calinou
Copy link
Member

Calinou commented Apr 1, 2020

Another way of using this feature is by having a quick-find menu like in other IDEs (search for a property keyword and having its doc link as well as an option to copy the code equivalent), but I guess it has already been proposed in some other thread ?

I remember seeing a proposal about this, but I can't find it right now.

@rezgi
Copy link
Author

rezgi commented Apr 2, 2020

Yeah I've searched for it but didn't find it neither. I think that maybe this proposal would be better implemented in a more general UX feature like the quick menu. If I find it I'll link this feature there.

@Calinou Calinou changed the title Copy a node property from the inspector Allow copy-pasting node property names in the inspector Jun 22, 2021
@YuriSizov
Copy link
Contributor

It is now possible to drag and drop the property path from the inspector into the code godotengine/godot#51628. I think that rules out the right-click, or double-click approach. If we were to handle the right click, a context menu would be a better option #3098.

So I think it's okay to close this in favor of all the other linked proposals.

@Calinou Calinou modified the milestones: 4.0, 3.x Aug 19, 2021
@elvisish
Copy link

It is now possible to drag and drop the property path from the inspector into the code godotengine/godot#51628. I think that rules out the right-click, or double-click approach. If we were to handle the right click, a context menu would be a better option #3098.

So I think it's okay to close this in favor of all the other linked proposals.

Thanks, I didn't know this was possible! I think since it's so unobvious that it can be done it should be a little more explicitly labeled as it's really useful when you need a long path name.

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

No branches or pull requests

5 participants