Open me2beats opened 2 years ago
I also ran into this problem when making a small plugin for the Output tab. This was my workaround for getting both the Output control and the ToolButton that opens it.
# This method is still quite hacky
var bottom_control = Control.new()
var bottom_btn = add_control_to_bottom_panel(bottom_control, "")
# Get editor log relative to the "dummy" control
editor_log = bottom_control.get_parent().get_child(0)
# Same with the ToolButton
tool_btn = bottom_btn.get_parent().get_child(0)
Describe the project you are working on
GDScript editor plugins (Godot 3 - but Godot 4 needs this too)
Describe the problem or limitation you are having in your project
I want to show the Output with a plugin, but this is not trivial. Currently I do it this way.
this just looks ugly.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
An ability to easily get bottom panel controls especially built-in controls such as Output (should return the control with type
EditorLog
), Debugger, Audio, Animation etc, would solve the problem.Then if I want to show it, I just
make_bottom_panel_item_visible(control)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I suggest adding 2 functions to
EditorPlugin
:Control
get_bottom_panel_control(control_name)
control name means kinda like control id, localization insensitive: isOutput
for Output,Debugger
for Debugger etc (not "title" because the title is different in different language localizations).For controls added by plugins (
add_control_to_bottom_panel
) name could be just a plugin title, later it is better to allow plugin developers to pass plugin custom id as an argumentadd_control_to_bottom_panel(control: Control, title: String, id: String)
Array
get_bottom_panel_controls_names()
returns an array with all controls names(ids) (Output
,Debugger
etc) including controls added by plugins.If this enhancement will not be used often, can it be worked around with a few lines of script?
See
the problem
section above - you can get the bottom panel controls but the way is ugly.Is there a reason why this should be core and not an add-on in the asset library?
This is for making plugins easier, so this should be core