summaryrefslogtreecommitdiff
path: root/modules/visual_script
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-27 22:49:16 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-28 14:24:09 +0100
commit09a6a2d8f83473b4893b4dd04ff31972e267d5d6 (patch)
tree1cacdc4c74f9cc941f214b5cb7a488f5e6875e2c /modules/visual_script
parentb8f08b42e7ca111a910f04475cb4d18435a17de1 (diff)
Signals: Port more uses of connect_compat
Those were problematic as they call a method of their parent class, but callable_mp does not allow that unless it's public. To solve it, we declare a local class that calls the parent class' method, which now needs to be protected to be accessible in the derived class.
Diffstat (limited to 'modules/visual_script')
-rw-r--r--modules/visual_script/visual_script_property_selector.cpp6
-rw-r--r--modules/visual_script/visual_script_property_selector.h10
2 files changed, 9 insertions, 7 deletions
diff --git a/modules/visual_script/visual_script_property_selector.cpp b/modules/visual_script/visual_script_property_selector.cpp
index f8b8a9f00b..a2baacb619 100644
--- a/modules/visual_script/visual_script_property_selector.cpp
+++ b/modules/visual_script/visual_script_property_selector.cpp
@@ -518,6 +518,10 @@ void VisualScriptPropertySelector::_item_selected() {
help_bit->set_text(text);
}
+void VisualScriptPropertySelector::_hide_requested() {
+ _closed(); // From WindowDialog.
+}
+
void VisualScriptPropertySelector::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -716,7 +720,7 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() {
seq_connect = false;
help_bit = memnew(EditorHelpBit);
vbc->add_margin_child(TTR("Description:"), help_bit);
- help_bit->connect_compat("request_hide", this, "_closed");
+ help_bit->connect("request_hide", callable_mp(this, &VisualScriptPropertySelector::_hide_requested));
search_options->set_columns(3);
search_options->set_column_expand(1, false);
search_options->set_column_expand(2, false);
diff --git a/modules/visual_script/visual_script_property_selector.h b/modules/visual_script/visual_script_property_selector.h
index a1eb0b842c..f438ca1f5b 100644
--- a/modules/visual_script/visual_script_property_selector.h
+++ b/modules/visual_script/visual_script_property_selector.h
@@ -41,16 +41,16 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
LineEdit *search_box;
Tree *search_options;
+ void _text_changed(const String &p_newtext);
+ void _sbox_input(const Ref<InputEvent> &p_ie);
void _update_search();
void create_visualscript_item(const String &name, TreeItem *const root, const String &search_input, const String &text);
-
void get_visual_node_names(const String &root_filter, const Set<String> &p_modifiers, bool &found, TreeItem *const root, LineEdit *const search_box);
- void _sbox_input(const Ref<InputEvent> &p_ie);
-
void _confirmed();
- void _text_changed(const String &p_newtext);
+ void _item_selected();
+ void _hide_requested();
EditorHelpBit *help_bit;
@@ -65,8 +65,6 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
bool virtuals_only;
bool seq_connect;
- void _item_selected();
-
Vector<Variant::Type> type_filter;
protected: