summaryrefslogtreecommitdiffstats
path: root/editor/multi_node_edit.cpp
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-10 09:37:51 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-10 09:37:51 +0100
commit824bc3fed880fe7837fc1e7f4c3936fc321a115a (patch)
treeb367f87175bf2efeb4a2eea5b570918d363d54f8 /editor/multi_node_edit.cpp
parent94f00eb6c5323dff933a4985b60e8ebf9391f940 (diff)
downloadredot-engine-824bc3fed880fe7837fc1e7f4c3936fc321a115a.tar.gz
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
Diffstat (limited to 'editor/multi_node_edit.cpp')
-rw-r--r--editor/multi_node_edit.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/editor/multi_node_edit.cpp b/editor/multi_node_edit.cpp
index 85e47594a8..0792d5c95f 100644
--- a/editor/multi_node_edit.cpp
+++ b/editor/multi_node_edit.cpp
@@ -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);
}