Fix compile.

This commit is contained in:
Relintai 2022-07-27 01:05:16 +02:00
parent 84ee52250c
commit 74dc60ec5f
2 changed files with 3 additions and 3 deletions

View File

@ -1175,7 +1175,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
UndoRedo *undo_redo = &editor_data->get_undo_redo(); UndoRedo *undo_redo = &editor_data->get_undo_redo();
Node *node = e->get(); Node *node = e->get();
bool enabled = node->is_unique_name_in_owner(); bool enabled = node->is_unique_name_in_owner();
if (!enabled && get_tree()->get_edited_scene_root()->get_node_or_null(UNIQUE_NODE_PREFIX + String(node->get_name())) != nullptr) { if (!enabled && get_tree()->get_edited_scene_root()->get_node_or_null("%" + String(node->get_name())) != nullptr) {
accept->set_text(TTR("Another node already uses this unique name in the scene.")); accept->set_text(TTR("Another node already uses this unique name in the scene."));
accept->popup_centered(); accept->popup_centered();
return; return;
@ -1419,7 +1419,7 @@ void SceneTreeDock::_node_replace_owner(Node *p_base, Node *p_node, Node *p_root
UndoRedo *undo_redo = &editor_data->get_undo_redo(); UndoRedo *undo_redo = &editor_data->get_undo_redo();
switch (p_mode) { switch (p_mode) {
case MODE_BIDI: { case MODE_BIDI: {
bool is_unique = p_node->is_unique_name_in_owner() && p_base->get_node_or_null(UNIQUE_NODE_PREFIX + String(p_node->get_name())) != nullptr; bool is_unique = p_node->is_unique_name_in_owner() && p_base->get_node_or_null("%" + String(p_node->get_name())) != nullptr;
if (is_unique) { if (is_unique) {
// Will create a unique name conflict. Disable before setting owner. // Will create a unique name conflict. Disable before setting owner.
undo_redo->add_do_method(p_node, "set_unique_name_in_owner", false); undo_redo->add_do_method(p_node, "set_unique_name_in_owner", false);

View File

@ -296,7 +296,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent, bool p_scroll
} }
if (p_node->is_unique_name_in_owner()) { if (p_node->is_unique_name_in_owner()) {
item->add_button(0, get_icon("SceneUniqueName", "EditorIcons"), BUTTON_UNIQUE, false, 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)); item->add_button(0, get_icon("SceneUniqueName", "EditorIcons"), BUTTON_UNIQUE, false, TTR("This node can be accessed from within anywhere in the scene by preceding it with the '%' prefix in a node path.\nClick to disable this."));
} }
int num_connections = p_node->get_persistent_signal_connection_count(); int num_connections = p_node->get_persistent_signal_connection_count();