diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-03 10:46:03 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-03 11:44:06 +0100 |
commit | 48ed841dd04887a4c59803daab154183a4194457 (patch) | |
tree | 32cf352dcb9defeb228742125ad343e972613973 /editor/plugins/visual_shader_editor_plugin.cpp | |
parent | da8a0913f481abd4704cd12fb10995c45b62c87d (diff) | |
download | redot-engine-48ed841dd04887a4c59803daab154183a4194457.tar.gz |
Signals: Fix some regressions from #36426
- Fix `callable_mp` bindings to methods which used to have default
arguments passed to `bind_method`. We now have to re-specify them
manually when connecting.
- Re-add `GroupsEditor::update_tree` binding.
- Misc code quality changes along the way.
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index e7b7c05901..4104e01612 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -2978,7 +2978,7 @@ class VisualShaderNodePluginDefaultEditor : public VBoxContainer { Ref<Resource> parent_resource; public: - void _property_changed(const String &prop, const Variant &p_value, const String &p_field, bool p_changing = false) { + void _property_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field = StringName(), bool p_changing = false) { if (p_changing) return; @@ -2986,13 +2986,13 @@ public: UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); updating = true; - undo_redo->create_action(TTR("Edit Visual Property") + ": " + prop, UndoRedo::MERGE_ENDS); - undo_redo->add_do_property(node.ptr(), prop, p_value); - undo_redo->add_undo_property(node.ptr(), prop, node->get(prop)); + undo_redo->create_action(TTR("Edit Visual Property") + ": " + p_property, UndoRedo::MERGE_ENDS); + undo_redo->add_do_property(node.ptr(), p_property, p_value); + undo_redo->add_undo_property(node.ptr(), p_property, node->get(p_property)); if (p_value.get_type() == Variant::OBJECT) { - RES prev_res = node->get(prop); + RES prev_res = node->get(p_property); RES curr_res = p_value; if (curr_res.is_null()) { @@ -3072,7 +3072,7 @@ public: p_properties[i]->connect("resource_selected", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_resource_selected)); } - properties[i]->connect("property_changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_property_changed)); + properties[i]->connect("property_changed", callable_mp(this, &VisualShaderNodePluginDefaultEditor::_property_changed), make_binds(StringName(), false)); properties[i]->set_object_and_property(node.ptr(), p_names[i]); properties[i]->update_property(); properties[i]->set_name_split_ratio(0); |