You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #103764 from kleonc/multi_node_edit_update_on_property_list_changed
Update `MultiNodeEdit` property list on edited nodes' property list changed
This commit is contained in:
@@ -219,8 +219,29 @@ bool MultiNodeEdit::_property_get_revert(const StringName &p_name, Variant &r_pr
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MultiNodeEdit::_queue_notify_property_list_changed() {
|
||||||
|
if (notify_property_list_changed_pending) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
notify_property_list_changed_pending = true;
|
||||||
|
callable_mp(this, &MultiNodeEdit::_notify_property_list_changed).call_deferred();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MultiNodeEdit::_notify_property_list_changed() {
|
||||||
|
notify_property_list_changed_pending = false;
|
||||||
|
notify_property_list_changed();
|
||||||
|
}
|
||||||
|
|
||||||
void MultiNodeEdit::add_node(const NodePath &p_node) {
|
void MultiNodeEdit::add_node(const NodePath &p_node) {
|
||||||
nodes.push_back(p_node);
|
nodes.push_back(p_node);
|
||||||
|
|
||||||
|
Node *es = EditorNode::get_singleton()->get_edited_scene();
|
||||||
|
if (es) {
|
||||||
|
Node *node = es->get_node_or_null(p_node);
|
||||||
|
if (node) {
|
||||||
|
node->connect(CoreStringName(property_list_changed), callable_mp(this, &MultiNodeEdit::_queue_notify_property_list_changed));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int MultiNodeEdit::get_node_count() const {
|
int MultiNodeEdit::get_node_count() const {
|
||||||
|
|||||||
@@ -36,12 +36,15 @@ class MultiNodeEdit : public RefCounted {
|
|||||||
GDCLASS(MultiNodeEdit, RefCounted);
|
GDCLASS(MultiNodeEdit, RefCounted);
|
||||||
|
|
||||||
LocalVector<NodePath> nodes;
|
LocalVector<NodePath> nodes;
|
||||||
|
bool notify_property_list_changed_pending = false;
|
||||||
struct PLData {
|
struct PLData {
|
||||||
int uses = 0;
|
int uses = 0;
|
||||||
PropertyInfo info;
|
PropertyInfo info;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool _set_impl(const StringName &p_name, const Variant &p_value, const String &p_field);
|
bool _set_impl(const StringName &p_name, const Variant &p_value, const String &p_field);
|
||||||
|
void _queue_notify_property_list_changed();
|
||||||
|
void _notify_property_list_changed();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|||||||
Reference in New Issue
Block a user