You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Keep focus on the top-most node for multi-selection in scene tree
Makes behavior consistent with selecting/deselecting single nodes and fixes a regression about the focused node being lost when multi-selecting. Fixes #33332
This commit is contained in:
@@ -34,12 +34,10 @@
|
||||
#include "editor_node.h"
|
||||
|
||||
bool MultiNodeEdit::_set(const StringName &p_name, const Variant &p_value) {
|
||||
|
||||
return _set_impl(p_name, p_value, "");
|
||||
}
|
||||
|
||||
bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value, const String &p_field) {
|
||||
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
if (!es)
|
||||
return false;
|
||||
@@ -88,7 +86,6 @@ bool MultiNodeEdit::_set_impl(const StringName &p_name, const Variant &p_value,
|
||||
}
|
||||
|
||||
bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
if (!es)
|
||||
return false;
|
||||
@@ -117,7 +114,6 @@ bool MultiNodeEdit::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
}
|
||||
|
||||
void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
|
||||
HashMap<String, PLData> usage;
|
||||
|
||||
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||
@@ -171,17 +167,23 @@ void MultiNodeEdit::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
}
|
||||
|
||||
void MultiNodeEdit::clear_nodes() {
|
||||
|
||||
nodes.clear();
|
||||
}
|
||||
|
||||
void MultiNodeEdit::add_node(const NodePath &p_node) {
|
||||
|
||||
nodes.push_back(p_node);
|
||||
}
|
||||
|
||||
void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
|
||||
int MultiNodeEdit::get_node_count() const {
|
||||
return nodes.size();
|
||||
}
|
||||
|
||||
NodePath MultiNodeEdit::get_node(int p_index) const {
|
||||
ERR_FAIL_INDEX_V(p_index, nodes.size(), NodePath());
|
||||
return nodes[p_index];
|
||||
}
|
||||
|
||||
void MultiNodeEdit::set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field) {
|
||||
_set_impl(p_property, p_value, p_field);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user