-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Refactor editor API to allow deep editor customizations #2537
Comments
As for the docks and bottom panels in general, I think that calling the components "docks" or "bottom panels" is kinda short-sighted, since in the future these components might be floating, or be located on a main screen, etc.
I think it would be more sensible to have a
get_component(component_name - String or enum)`
get_plugin(name: String)
set_enabled(plugin_name: String, enable: bool),
get_enabled(name)
get_plugin_list()
#as well as maybe:
add_inspector_plugin()` and others like that. |
This would be nice when it happens, but unfortunately this is not the case right now. Each place has a different API, and they are not trivial to merge in a unified API, especially the main screen/workspace one.
I had though about having a Instead, a
I prefer having separated getters as each component has a dedicated API for its customization, and for type safety/autocompletion stuff. |
All the linked PRs were rejected, but I'm not going to close this because the listed issues still exist and an alternative solution (but related) was discussed in the Godot contributor chat. Also, this is the only existing proposal where there is a generic solution for the listed issues. |
Related to #300, #1761, #2276
See also godotengine/godot#47520
Glossary
Other UI words came from here
Describe the project you are working on
Unrelated to the proposal.
Describe the problem or limitation you are having in your project
Currently, the editor API are quite limited.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Provide simplified access for most parts of the UI
The idea is to provide different levels of access to the components:
EditorPlugin
or in a proper singleton.The granularity of getters should be discussed, but the intention is not to expose every button or worse.
Group editor components in singletons
In a complex UI like the Godot Editor, it is necessary to split and group all the component interfaces.
So I propose to have several singletons, obtainable though
EditorPlugin
.EditorDocks
for docks and to get the builtin ones.EditorWorkspaces
for workspaces and to get the builtin ones.EditorBottomPanels
(or justEditorPanels
) for panels and to get the bultin ones.EditorComponentPluginInterface
(! better name required) for managing component-specific editor plugins.This acts mostly as a helper and the same interfaces (mostly adding/removing plugins) must be exposed by each component
Note that some panels are showed depending on the context (e.g. Animation) so they may not be available.
... and other ....
EditorInterface
(I preferEditorRoot
) for top level plugins and getting the main menu, the playtest or other interfaces that does not belong to other singletons.Other enhancement
EditorPlugin
).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Most was described above, but an editor plugin entry point should look like this (in GDScript):
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not always, while it is possible to get every node navigating the scene tree, some nodes have internal objects to manage their status and appearance, and they are not available mostly.
Is there a reason why this should be core and not an add-on in the asset library?
Requires changes in the editor.
Unrelated to the proposal
The text was updated successfully, but these errors were encountered: