diff options
Diffstat (limited to 'scene/gui/tree.cpp')
-rw-r--r-- | scene/gui/tree.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 08835be9fd..940692ebd7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -729,18 +729,18 @@ bool TreeItem::is_folding_disabled() const { return disable_folding; } -Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (p_argcount < 1) { - r_error.error = Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; + r_error.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS; r_error.argument = 0; return Variant(); } - if (p_args[0]->get_type() != Variant::STRING) { - r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + if (p_args[0]->get_type() != Variant::STRING && p_args[0]->get_type() != Variant::STRING_NAME) { + r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument = 0; - r_error.expected = Variant::STRING; + r_error.expected = Variant::STRING_NAME; return Variant(); } @@ -750,7 +750,7 @@ Variant TreeItem::_call_recursive_bind(const Variant **p_args, int p_argcount, V return Variant(); } -void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { if (!p_item) { return; } @@ -762,7 +762,7 @@ void recursive_call_aux(TreeItem *p_item, const StringName &p_method, const Vari } } -void TreeItem::call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Variant::CallError &r_error) { +void TreeItem::call_recursive(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { recursive_call_aux(this, p_method, p_args, p_argcount, r_error); } @@ -861,7 +861,7 @@ void TreeItem::_bind_methods() { { MethodInfo mi; mi.name = "call_recursive"; - mi.arguments.push_back(PropertyInfo(Variant::STRING, "method")); + mi.arguments.push_back(PropertyInfo(Variant::STRING_NAME, "method")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "call_recursive", &TreeItem::_call_recursive_bind, mi); } @@ -1020,7 +1020,7 @@ int Tree::compute_item_height(TreeItem *p_item) const { int check_icon_h = cache.checked->get_height(); if (height < check_icon_h) height = check_icon_h; - FALLTHROUGH; + [[fallthrough]]; } case TreeItem::CELL_MODE_STRING: case TreeItem::CELL_MODE_CUSTOM: @@ -4043,15 +4043,15 @@ Tree::Tree() { add_child(v_scroll); range_click_timer = memnew(Timer); - range_click_timer->connect("timeout", this, "_range_click_timeout"); + range_click_timer->connect_compat("timeout", this, "_range_click_timeout"); add_child(range_click_timer); - h_scroll->connect("value_changed", this, "_scroll_moved"); - v_scroll->connect("value_changed", this, "_scroll_moved"); - text_editor->connect("text_entered", this, "_text_editor_enter"); - text_editor->connect("modal_closed", this, "_text_editor_modal_close"); - popup_menu->connect("id_pressed", this, "_popup_select"); - value_editor->connect("value_changed", this, "_value_editor_changed"); + h_scroll->connect_compat("value_changed", this, "_scroll_moved"); + v_scroll->connect_compat("value_changed", this, "_scroll_moved"); + text_editor->connect_compat("text_entered", this, "_text_editor_enter"); + text_editor->connect_compat("modal_closed", this, "_text_editor_modal_close"); + popup_menu->connect_compat("id_pressed", this, "_popup_select"); + value_editor->connect_compat("value_changed", this, "_value_editor_changed"); value_editor->set_as_toplevel(true); text_editor->set_as_toplevel(true); |