diff options
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r-- | editor/editor_help.cpp | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 0ade4c5c80..b26fa77e16 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -66,7 +66,7 @@ void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) { Ref<InputEventKey> k = p_ev; - if (k.is_valid() && k->get_control() && k->get_scancode() == KEY_F) { + if (k.is_valid() && k->get_control() && k->get_keycode() == KEY_F) { search->grab_focus(); search->select_all(); @@ -1529,9 +1529,6 @@ void EditorHelp::set_scroll(int p_scroll) { void EditorHelp::_bind_methods() { ClassDB::bind_method("_class_list_select", &EditorHelp::_class_list_select); - ClassDB::bind_method("_class_desc_select", &EditorHelp::_class_desc_select); - ClassDB::bind_method("_class_desc_input", &EditorHelp::_class_desc_input); - ClassDB::bind_method("_class_desc_resized", &EditorHelp::_class_desc_resized); ClassDB::bind_method("_request_help", &EditorHelp::_request_help); ClassDB::bind_method("_unhandled_key_input", &EditorHelp::_unhandled_key_input); ClassDB::bind_method("_search", &EditorHelp::_search); @@ -1551,9 +1548,9 @@ EditorHelp::EditorHelp() { class_desc->set_v_size_flags(SIZE_EXPAND_FILL); class_desc->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); - class_desc->connect("meta_clicked", this, "_class_desc_select"); - class_desc->connect("gui_input", this, "_class_desc_input"); - class_desc->connect("resized", this, "_class_desc_resized"); + class_desc->connect("meta_clicked", callable_mp(this, &EditorHelp::_class_desc_select)); + class_desc->connect("gui_input", callable_mp(this, &EditorHelp::_class_desc_input)); + class_desc->connect("resized", callable_mp(this, &EditorHelp::_class_desc_resized)); _class_desc_resized(); // Added second so it opens at the bottom so it won't offset the entire widget. @@ -1607,7 +1604,6 @@ void EditorHelpBit::_meta_clicked(String p_select) { void EditorHelpBit::_bind_methods() { - ClassDB::bind_method("_meta_clicked", &EditorHelpBit::_meta_clicked); ClassDB::bind_method(D_METHOD("set_text", "text"), &EditorHelpBit::set_text); ADD_SIGNAL(MethodInfo("request_hide")); } @@ -1633,7 +1629,7 @@ EditorHelpBit::EditorHelpBit() { rich_text = memnew(RichTextLabel); add_child(rich_text); - rich_text->connect("meta_clicked", this, "_meta_clicked"); + rich_text->connect("meta_clicked", callable_mp(this, &EditorHelpBit::_meta_clicked)); rich_text->add_color_override("selection_color", get_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); rich_text->set_override_selected_font_color(false); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); @@ -1645,8 +1641,8 @@ FindBar::FindBar() { add_child(search_text); search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0)); search_text->set_h_size_flags(SIZE_EXPAND_FILL); - search_text->connect("text_changed", this, "_search_text_changed"); - search_text->connect("text_entered", this, "_search_text_entered"); + search_text->connect("text_changed", callable_mp(this, &FindBar::_search_text_changed)); + search_text->connect("text_entered", callable_mp(this, &FindBar::_search_text_entered)); matches_label = memnew(Label); add_child(matches_label); @@ -1655,12 +1651,12 @@ FindBar::FindBar() { find_prev = memnew(ToolButton); add_child(find_prev); find_prev->set_focus_mode(FOCUS_NONE); - find_prev->connect("pressed", this, "_search_prev"); + find_prev->connect("pressed", callable_mp(this, &FindBar::search_prev)); find_next = memnew(ToolButton); add_child(find_next); find_next->set_focus_mode(FOCUS_NONE); - find_next->connect("pressed", this, "_search_next"); + find_next->connect("pressed", callable_mp(this, &FindBar::search_next)); Control *space = memnew(Control); add_child(space); @@ -1671,7 +1667,7 @@ FindBar::FindBar() { hide_button->set_focus_mode(FOCUS_NONE); hide_button->set_expand(true); hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); - hide_button->connect("pressed", this, "_hide_pressed"); + hide_button->connect("pressed", callable_mp(this, &FindBar::_hide_bar)); } void FindBar::popup_search() { @@ -1717,12 +1713,6 @@ void FindBar::_bind_methods() { ClassDB::bind_method("_unhandled_input", &FindBar::_unhandled_input); - ClassDB::bind_method("_search_text_changed", &FindBar::_search_text_changed); - ClassDB::bind_method("_search_text_entered", &FindBar::_search_text_entered); - ClassDB::bind_method("_search_next", &FindBar::search_next); - ClassDB::bind_method("_search_prev", &FindBar::search_prev); - ClassDB::bind_method("_hide_pressed", &FindBar::_hide_bar); - ADD_SIGNAL(MethodInfo("search")); } @@ -1813,7 +1803,7 @@ void FindBar::_unhandled_input(const Ref<InputEvent> &p_event) { bool accepted = true; - switch (k->get_scancode()) { + switch (k->get_keycode()) { case KEY_ESCAPE: { |