Fix "Change Type" ignoring non-top-level nodes and editing foreign nodes#119909
Conversation
Change Type ignoring non-top-level nodes and editing foreign nodese82a446 to
d70032f
Compare
This was already the case before this PR. When could foreign node change type?
Shortcuts exist. |
You are right about this. I will remove it then.
My poor choice of words... I meant by default, since "Change Type" does not have a default shortcut like "Rename (F2)". I will remove it then. |
So the note about correctly hiding it is also irrelevant, or...? |
That one is relevant. In
|
KoBeWi
left a comment
There was a problem hiding this comment.
The comments are questionable, but the code itself looks fine.
|
|
||
| } else if (current_option == TOOL_CHANGE_TYPE) { | ||
| const List<Node *> selection = editor_selection->get_top_selected_node_list(); | ||
| // TODO: Rename selection to full_selection? |
There was a problem hiding this comment.
Either remove or act on this comment, it's not that many changes.
The code for TOOL_REPARENT_TO_NEW_NODE also has selection instead of top_selection, so IMO it just doesn't matter.
There was a problem hiding this comment.
Removed the comment (at line 3872).
| ERR_FAIL_COND(!EditorNode::get_singleton()->get_edited_scene()); | ||
| menu->clear(false); | ||
|
|
||
| // TODO: Rename selection to top_selection? |
There was a problem hiding this comment.
Here the rename makes more sense.
There was a problem hiding this comment.
Acted on the comment (at line 3138).
| // Returns only the top-level selected nodes (i.e. excludes any selected node whose parent is also selected). | ||
| // The first node selected by the user is at the front of the list (i.e. not sorted in scene tree order). | ||
| const List<Node *> selection = editor_selection->get_top_selected_node_list(); | ||
| List<Node *> full_selection = editor_selection->get_full_selected_node_list(); // Above method only returns nodes with common parent. | ||
| // Returns all selected nodes (list version of "get_selected_nodes"). | ||
| // The first node selected by the user is at the front of the list (i.e. not sorted in scene tree order). |
There was a problem hiding this comment.
I don't think these methods should be explained here.
Also there are similar exposed methods (get_selected_nodes() and get_top_selected_nodes()) so technically they're already documented.
There was a problem hiding this comment.
Updated the comment. I think some comments here would still be helpful, since the variable declarations are quite far away, unlike in the other methods.
d70032f to
97c7b9f
Compare
…nodes/ being available when it is not.
97c7b9f to
8984aff
Compare
|
Updated questionable comments. Properly removed |
|
Thanks! |

Closes #74236
Related: #119593
Note: Split from #119617. Can be merged separately.
Changes:
_validate_no_foreign(); now uses_validate_no_foreign_selected()._validate_no_instance(); now uses_validate_no_instance_selected().Video:
fix_change_type_selection.mp4