You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Fix method dialog label
This commit is contained in:
@@ -338,11 +338,6 @@ void ConnectDialog::_update_method_tree() {
|
|||||||
// If a script is attached, get methods from it.
|
// If a script is attached, get methods from it.
|
||||||
ScriptInstance *si = target->get_script_instance();
|
ScriptInstance *si = target->get_script_instance();
|
||||||
if (si) {
|
if (si) {
|
||||||
TreeItem *si_item = method_tree->create_item(root_item);
|
|
||||||
si_item->set_text(0, TTR("Attached Script"));
|
|
||||||
si_item->set_icon(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons")));
|
|
||||||
si_item->set_selectable(0, false);
|
|
||||||
|
|
||||||
if (si->get_script()->is_built_in()) {
|
if (si->get_script()->is_built_in()) {
|
||||||
si->get_script()->reload();
|
si->get_script()->reload();
|
||||||
}
|
}
|
||||||
@@ -350,9 +345,12 @@ void ConnectDialog::_update_method_tree() {
|
|||||||
si->get_method_list(&methods);
|
si->get_method_list(&methods);
|
||||||
methods = _filter_method_list(methods, signal_info, search_string);
|
methods = _filter_method_list(methods, signal_info, search_string);
|
||||||
|
|
||||||
if (methods.is_empty()) {
|
if (!methods.is_empty()) {
|
||||||
si_item->set_custom_color(0, disabled_color);
|
TreeItem *si_item = method_tree->create_item(root_item);
|
||||||
} else {
|
si_item->set_text(0, TTR("Attached Script"));
|
||||||
|
si_item->set_icon(0, get_theme_icon(SNAME("Script"), SNAME("EditorIcons")));
|
||||||
|
si_item->set_selectable(0, false);
|
||||||
|
|
||||||
_create_method_tree_items(methods, si_item);
|
_create_method_tree_items(methods, si_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -687,8 +685,10 @@ ConnectDialog::ConnectDialog() {
|
|||||||
method_tree->connect("item_activated", callable_mp((Window *)method_popup, &Window::hide));
|
method_tree->connect("item_activated", callable_mp((Window *)method_popup, &Window::hide));
|
||||||
|
|
||||||
empty_tree_label = memnew(Label(TTR("No method found matching given filters.")));
|
empty_tree_label = memnew(Label(TTR("No method found matching given filters.")));
|
||||||
method_tree->add_child(empty_tree_label);
|
method_popup->add_child(empty_tree_label);
|
||||||
empty_tree_label->set_anchors_and_offsets_preset(Control::PRESET_CENTER);
|
empty_tree_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
|
||||||
|
empty_tree_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
|
||||||
|
empty_tree_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD);
|
||||||
|
|
||||||
script_methods_only = memnew(CheckButton(TTR("Script Methods Only")));
|
script_methods_only = memnew(CheckButton(TTR("Script Methods Only")));
|
||||||
method_vbc->add_child(script_methods_only);
|
method_vbc->add_child(script_methods_only);
|
||||||
|
|||||||
Reference in New Issue
Block a user