Extract BottomPanel from EditorNode

This commit is contained in:
kit 2024-01-30 17:22:22 -05:00
parent 1aab6e96b9
commit eb6ca91ba6
22 changed files with 438 additions and 315 deletions

View file

@ -38,6 +38,7 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_undo_redo_manager.h"
#include "editor/gui/editor_bottom_panel.h"
#include "editor/gui/editor_file_dialog.h"
#include "editor/inspector_dock.h"
#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
@ -790,7 +791,7 @@ void AnimationPlayerEditor::set_state(const Dictionary &p_state) {
}
_update_player();
EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
EditorNode::get_bottom_panel()->make_item_visible(this);
set_process(true);
ensure_visibility();
@ -2192,7 +2193,7 @@ bool AnimationPlayerEditorPlugin::handles(Object *p_object) const {
void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
EditorNode::get_singleton()->make_bottom_panel_item_visible(anim_editor);
EditorNode::get_bottom_panel()->make_item_visible(anim_editor);
anim_editor->set_process(true);
anim_editor->ensure_visibility();
}
@ -2200,7 +2201,7 @@ void AnimationPlayerEditorPlugin::make_visible(bool p_visible) {
AnimationPlayerEditorPlugin::AnimationPlayerEditorPlugin() {
anim_editor = memnew(AnimationPlayerEditor(this));
EditorNode::get_singleton()->add_bottom_panel_item(TTR("Animation"), anim_editor);
EditorNode::get_bottom_panel()->add_item(TTR("Animation"), anim_editor);
}
AnimationPlayerEditorPlugin::~AnimationPlayerEditorPlugin() {