From 8cfded59343a17529f7f4573018dbf586ab8612b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 25 Mar 2024 23:12:26 +0800 Subject: [PATCH] Improve replication editor's pin button - When unpressed, only hide the editor if MultiplayerSynchronizer is not selected. - Add tooltip text. --- modules/multiplayer/editor/multiplayer_editor_plugin.cpp | 2 +- modules/multiplayer/editor/replication_editor.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp index 599926ec996..29ebc38edfe 100644 --- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp +++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp @@ -149,7 +149,7 @@ void MultiplayerEditorPlugin::_node_removed(Node *p_node) { } void MultiplayerEditorPlugin::_pinned() { - if (!repl_editor->get_pin()->is_pressed()) { + if (!repl_editor->get_pin()->is_pressed() && repl_editor->get_current() == nullptr) { if (repl_editor->is_visible_in_tree()) { EditorNode::get_bottom_panel()->hide_bottom_panel(); } diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index f6df212d35f..58803124cfc 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -270,6 +270,7 @@ ReplicationEditor::ReplicationEditor() { pin = memnew(Button); pin->set_theme_type_variation("FlatButton"); pin->set_toggle_mode(true); + pin->set_tooltip_text(TTR("Pin replication editor")); hb->add_child(pin); tree = memnew(Tree);