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

Store panels and docks instances in their classes #55066

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5012,7 +5012,7 @@ struct _AnimMoveRestore {
void AnimationTrackEditor::_clear_key_edit() {
if (key_edit) {
// If key edit is the object being inspected, remove it first.
if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) {
if (InspectorDock::get_inspector_singleton()->get_edited_object() == key_edit) {
EditorNode::get_singleton()->push_item(nullptr);
}

Expand All @@ -5022,7 +5022,7 @@ void AnimationTrackEditor::_clear_key_edit() {
}

if (multi_key_edit) {
if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) {
if (InspectorDock::get_inspector_singleton()->get_edited_object() == multi_key_edit) {
EditorNode::get_singleton()->push_item(nullptr);
}

Expand Down
12 changes: 6 additions & 6 deletions editor/connections_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ void ConnectionsDock::_connect(ConnectDialog::ConnectionData p_cd) {
undo_redo->add_undo_method(source, "disconnect", p_cd.signal, callable);
undo_redo->add_do_method(this, "update_tree");
undo_redo->add_undo_method(this, "update_tree");
undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); // To force redraw of scene tree.
undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
undo_redo->add_do_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree"); // To force redraw of scene tree.
undo_redo->add_undo_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree");

undo_redo->commit_action();
}
Expand All @@ -671,8 +671,8 @@ void ConnectionsDock::_disconnect(TreeItem &p_item) {
undo_redo->add_undo_method(selected_node, "connect", cd.signal, callable, cd.binds, cd.flags);
undo_redo->add_do_method(this, "update_tree");
undo_redo->add_undo_method(this, "update_tree");
undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); // To force redraw of scene tree.
undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
undo_redo->add_do_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree"); // To force redraw of scene tree.
undo_redo->add_undo_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree");

undo_redo->commit_action();
}
Expand Down Expand Up @@ -702,8 +702,8 @@ void ConnectionsDock::_disconnect_all() {

undo_redo->add_do_method(this, "update_tree");
undo_redo->add_undo_method(this, "update_tree");
undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
undo_redo->add_do_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree");
undo_redo->add_undo_method(SceneTreeDock::get_singleton()->get_tree_editor(), "update_tree");

undo_redo->commit_action();
}
Expand Down
14 changes: 7 additions & 7 deletions editor/debugger/editor_debugger_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ EditorDebuggerNode::EditorDebuggerNode() {
remote_scene_tree = memnew(EditorDebuggerTree);
remote_scene_tree->connect("object_selected", callable_mp(this, &EditorDebuggerNode::_remote_object_requested));
remote_scene_tree->connect("save_node", callable_mp(this, &EditorDebuggerNode::_save_node_requested));
EditorNode::get_singleton()->get_scene_tree_dock()->add_remote_tree_editor(remote_scene_tree);
EditorNode::get_singleton()->get_scene_tree_dock()->connect("remote_tree_selected", callable_mp(this, &EditorDebuggerNode::request_remote_tree));
SceneTreeDock::get_singleton()->add_remote_tree_editor(remote_scene_tree);
SceneTreeDock::get_singleton()->connect("remote_tree_selected", callable_mp(this, &EditorDebuggerNode::request_remote_tree));

remote_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0);
inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2);
Expand Down Expand Up @@ -332,10 +332,10 @@ void EditorDebuggerNode::_notification(int p_what) {
// Switch to remote tree view if so desired.
auto_switch_remote_scene_tree = (bool)EditorSettings::get_singleton()->get("debugger/auto_switch_to_remote_scene_tree");
if (auto_switch_remote_scene_tree) {
EditorNode::get_singleton()->get_scene_tree_dock()->show_remote_tree();
SceneTreeDock::get_singleton()->show_remote_tree();
}
// Good to go.
EditorNode::get_singleton()->get_scene_tree_dock()->show_tab_buttons();
SceneTreeDock::get_singleton()->show_tab_buttons();
debugger->set_editor_remote_tree(remote_scene_tree);
debugger->start(server->take_connection());
// Send breakpoints.
Expand All @@ -361,8 +361,8 @@ void EditorDebuggerNode::_debugger_stopped(int p_id) {
if (!found) {
EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
EditorNode::get_singleton()->get_pause_button()->set_disabled(true);
EditorNode::get_singleton()->get_scene_tree_dock()->hide_remote_tree();
EditorNode::get_singleton()->get_scene_tree_dock()->hide_tab_buttons();
SceneTreeDock::get_singleton()->hide_remote_tree();
SceneTreeDock::get_singleton()->hide_tab_buttons();
EditorNode::get_singleton()->notify_all_debug_sessions_exited();
}
}
Expand Down Expand Up @@ -576,7 +576,7 @@ void EditorDebuggerNode::_remote_object_property_updated(ObjectID p_id, const St
if (obj->remote_object_id != p_id) {
return;
}
EditorNode::get_singleton()->get_inspector()->update_property(p_property);
InspectorDock::get_inspector_singleton()->update_property(p_property);
}
}

Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_debugger_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) {
void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int p_debugger) {
updating_scene_tree = true;
const String last_path = get_selected_path();
const String filter = EditorNode::get_singleton()->get_scene_tree_dock()->get_filter();
const String filter = SceneTreeDock::get_singleton()->get_filter();
bool filter_changed = filter != last_filter;
TreeItem *scroll_item = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ void EditorAudioBuses::_server_save() {
}

void EditorAudioBuses::_select_layout() {
EditorNode::get_singleton()->get_filesystem_dock()->select_file(edited_path);
FileSystemDock::get_singleton()->select_file(edited_path);
}

void EditorAudioBuses::_save_as_layout() {
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,10 @@ String EditorProperty::get_tooltip_text() const {
void EditorProperty::menu_option(int p_option) {
switch (p_option) {
case MENU_COPY_PROPERTY: {
EditorNode::get_singleton()->get_inspector()->set_property_clipboard(object->get(property));
InspectorDock::get_inspector_singleton()->set_property_clipboard(object->get(property));
} break;
case MENU_PASTE_PROPERTY: {
emit_changed(property, EditorNode::get_singleton()->get_inspector()->get_property_clipboard());
emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard());
} break;
case MENU_COPY_PROPERTY_PATH: {
DisplayServer::get_singleton()->clipboard_set(property);
Expand Down
Loading