Skip to content

Commit 8f5b11a

Browse files
committed
[Editor] Update SceneUniqueName button text when disabled to clarify access.
1 parent c6c464c commit 8f5b11a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

editor/gui/scene_tree_editor.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
344344
}
345345

346346
if (p_node->is_unique_name_in_owner()) {
347-
item->add_button(0, get_editor_theme_icon(SNAME("SceneUniqueName")), BUTTON_UNIQUE, p_node->get_owner() != EditorNode::get_singleton()->get_edited_scene(), vformat(TTR("This node can be accessed from within anywhere in the scene by preceding it with the '%s' prefix in a node path.\nClick to disable this."), UNIQUE_NODE_PREFIX));
347+
const bool disabled = p_node->get_owner() != EditorNode::get_singleton()->get_edited_scene();
348+
String button_text = vformat(TTR("This node can be accessed from anywhere within the scene it belongs to by using the '%s' prefix in the node path."), UNIQUE_NODE_PREFIX);
349+
if (!disabled) {
350+
button_text += "\n" + TTR("Click to disable this.");
351+
}
352+
item->add_button(0, get_editor_theme_icon(SNAME("SceneUniqueName")), BUTTON_UNIQUE, disabled, button_text);
348353
}
349354

350355
int num_connections = p_node->get_persistent_signal_connection_count();

0 commit comments

Comments
 (0)