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 add_control/create_editor_property to EditorInspectorPlugin #24053

Open
xDGameStudios opened this issue Nov 29, 2018 · 0 comments
Open

Add add_control/create_editor_property to EditorInspectorPlugin #24053

xDGameStudios opened this issue Nov 29, 2018 · 0 comments

Comments

@xDGameStudios
Copy link
Contributor

xDGameStudios commented Nov 29, 2018

Godot version:
v3.1.alpha.calinou.5b8dde4

OS/device including version:
Not relevant.

Issue description:
Right now it is possible to overload the Inspector draw to add custom controls, if you want to create completely new controls but what about adding builtin controls?
I propose that add_control function should be added. Something in the lines of

add_control(object, type, path, hint, hint_text, usage)

that could create the builtin control and link it to the object variable. then the object would handle the set and get using the _set, _get variables. I know that can be done via _get_property_list() but we can't control the order in which the properties are draw to screen, so this new function would give more power to create custom inspectors.

Ideally it would be even better to have a static method (that could be inside EditorInspectorPlugin or EditorInspector):

create_editor_property(type, property_name) -> Control:

that would return a control that could be added later to a custom control in order to control layout in a easy way

another thing (this is a suggestion and I wanted to gather some discussion points) it would be neat to link the _set and _get functions of the target class with the ones or with equivalent functions in EditorInspectorPlugin class. It makes more sense that the inspector related stuff is kept all in the same place and mix resource/scene data with with inspector logic is not very clean.

Steps to reproduce:
N/A

Minimal reproduction project:
N/A

@xDGameStudios xDGameStudios changed the title Add add_control to EditorInspectorPlugin Add add_control/create_editor_property to EditorInspectorPlugin Nov 29, 2018
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

2 participants