Update deferred calls to use Callables

This commit is contained in:
kobewi 2023-12-18 15:46:56 +01:00
parent 8297ec949b
commit 0e8f90f4c8
92 changed files with 192 additions and 350 deletions

View File

@ -31,13 +31,12 @@
#include "callable.h"
#include "callable_bind.h"
#include "core/object/message_queue.h"
#include "core/object/object.h"
#include "core/object/ref_counted.h"
#include "core/object/script_language.h"
void Callable::call_deferredp(const Variant **p_arguments, int p_argcount) const {
MessageQueue::get_singleton()->push_callablep(*this, p_arguments, p_argcount);
MessageQueue::get_singleton()->push_callablep(*this, p_arguments, p_argcount, true);
}
void Callable::callp(const Variant **p_arguments, int p_argcount, Variant &r_return_value, CallError &r_call_error) const {

View File

@ -908,7 +908,7 @@ void AnimationBezierTrackEdit::gui_input(const Ref<InputEvent> &p_event) {
if (Math::is_finite(minimum_time) && Math::is_finite(maximum_time) && maximum_time - minimum_time > CMP_EPSILON) {
timeline->get_zoom()->set_value(zoom_value);
timeline->call_deferred("set_value", minimum_time);
callable_mp((Range *)timeline, &Range::set_value).call_deferred(minimum_time);
}
if (Math::is_finite(minimum_value) && Math::is_finite(maximum_value)) {

View File

@ -4613,7 +4613,7 @@ void AnimationTrackEditor::_animation_changed() {
}
animation_changing_awaiting_update = true;
call_deferred(SNAME("_animation_update"));
callable_mp(this, &AnimationTrackEditor::_animation_update).call_deferred();
}
void AnimationTrackEditor::_snap_mode_changed(int p_mode) {
@ -6478,7 +6478,6 @@ void AnimationTrackEditor::_select_all_tracks_for_copy() {
}
void AnimationTrackEditor::_bind_methods() {
ClassDB::bind_method("_animation_update", &AnimationTrackEditor::_animation_update);
ClassDB::bind_method("_track_grab_focus", &AnimationTrackEditor::_track_grab_focus);
ClassDB::bind_method("_redraw_tracks", &AnimationTrackEditor::_redraw_tracks);
ClassDB::bind_method("_clear_selection_for_anim", &AnimationTrackEditor::_clear_selection_for_anim);

View File

@ -158,7 +158,7 @@ void AudioStreamPreviewGenerator::_preview_thread(void *p_preview) {
}
frames_todo -= to_read;
singleton->call_deferred(SNAME("_update_emit"), preview->id);
callable_mp(singleton, &AudioStreamPreviewGenerator::_update_emit).call_deferred(preview->id);
}
preview->preview->version++;
@ -216,7 +216,6 @@ Ref<AudioStreamPreview> AudioStreamPreviewGenerator::generate_preview(const Ref<
}
void AudioStreamPreviewGenerator::_bind_methods() {
ClassDB::bind_method("_update_emit", &AudioStreamPreviewGenerator::_update_emit);
ClassDB::bind_method(D_METHOD("generate_preview", "stream"), &AudioStreamPreviewGenerator::generate_preview);
ADD_SIGNAL(MethodInfo("preview_updated", PropertyInfo(Variant::INT, "obj_id")));

View File

@ -336,7 +336,7 @@ void FindReplaceBar::_replace_all() {
matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
matches_label->set_text(vformat(TTR("%d replaced."), rc));
text_editor->call_deferred(SNAME("connect"), "text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed));
callable_mp((Object *)text_editor, &Object::connect).call_deferred("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed), 0U);
results_count = -1;
results_count_to_current = -1;
needs_to_count_results = true;
@ -517,10 +517,10 @@ void FindReplaceBar::_show_search(bool p_focus_replace, bool p_show_only) {
if (p_focus_replace) {
search_text->deselect();
replace_text->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)replace_text, &Control::grab_focus).call_deferred();
} else {
replace_text->deselect();
search_text->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)search_text, &Control::grab_focus).call_deferred();
}
if (text_editor->has_selection(0) && !is_selection_only()) {
@ -1572,20 +1572,20 @@ void CodeTextEditor::goto_line(int p_line) {
text_editor->remove_secondary_carets();
text_editor->deselect();
text_editor->unfold_line(p_line);
text_editor->call_deferred(SNAME("set_caret_line"), p_line);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_line).call_deferred(p_line, true, true, 0, 0);
}
void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
text_editor->remove_secondary_carets();
text_editor->unfold_line(p_line);
text_editor->call_deferred(SNAME("set_caret_line"), p_line);
text_editor->call_deferred(SNAME("set_caret_column"), p_begin);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_line).call_deferred(p_line, true, true, 0, 0);
callable_mp((TextEdit *)text_editor, &TextEdit::set_caret_column).call_deferred(p_begin, true, 0);
text_editor->select(p_line, p_begin, p_line, p_end);
}
void CodeTextEditor::goto_line_centered(int p_line) {
goto_line(p_line);
text_editor->call_deferred(SNAME("center_viewport_to_caret"));
callable_mp((TextEdit *)text_editor, &TextEdit::center_viewport_to_caret).call_deferred(0);
}
void CodeTextEditor::set_executing_line(int p_line) {

View File

@ -474,7 +474,7 @@ void CreateDialog::_notification(int p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
search_box->call_deferred(SNAME("grab_focus")); // still not visible
callable_mp((Control *)search_box, &Control::grab_focus).call_deferred(); // Still not visible.
search_box->select_all();
} else {
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "create_new_node", Rect2(get_position(), get_size()));

View File

@ -455,7 +455,7 @@ void EditorDebuggerNode::_debugger_wants_stop(int p_id) {
// Ask editor to kill PID.
int pid = get_debugger(p_id)->get_remote_pid();
if (pid) {
EditorNode::get_singleton()->call_deferred(SNAME("stop_child_process"), pid);
callable_mp(EditorNode::get_singleton(), &EditorNode::stop_child_process).call_deferred(pid);
}
}

View File

@ -253,7 +253,7 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
}
debugger_id = p_debugger; // Needed by hook, could be avoided if every debugger had its own tree
if (scroll_item) {
call_deferred(SNAME("scroll_to_item"), scroll_item);
callable_mp((Tree *)this, &Tree::scroll_to_item).call_deferred(scroll_item, false);
}
last_filter = filter;
updating_scene_tree = false;

View File

@ -1234,7 +1234,7 @@ void EditorAudioBuses::_load_default_layout() {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}
void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
@ -1250,7 +1250,7 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
} else if (file_dialog->get_file_mode() == EditorFileDialog::FILE_MODE_SAVE_FILE) {
if (new_layout) {
@ -1270,14 +1270,13 @@ void EditorAudioBuses::_file_dialog_callback(const String &p_string) {
file->set_text(String(TTR("Layout:")) + " " + p_string.get_file());
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}
}
void EditorAudioBuses::_bind_methods() {
ClassDB::bind_method("_update_bus", &EditorAudioBuses::_update_bus);
ClassDB::bind_method("_update_sends", &EditorAudioBuses::_update_sends);
ClassDB::bind_method("_select_layout", &EditorAudioBuses::_select_layout);
}
EditorAudioBuses::EditorAudioBuses() {
@ -1370,7 +1369,7 @@ void EditorAudioBuses::open_layout(const String &p_path) {
AudioServer::get_singleton()->set_bus_layout(state);
_rebuild_buses();
EditorUndoRedoManager::get_singleton()->clear_history(true, EditorUndoRedoManager::GLOBAL_HISTORY);
call_deferred(SNAME("_select_layout"));
callable_mp(this, &EditorAudioBuses::_select_layout).call_deferred();
}
void AudioBusesEditorPlugin::edit(Object *p_node) {

View File

@ -57,7 +57,7 @@ void EditorAutoloadSettings::_notification(int p_what) {
for (const AutoloadInfo &info : autoload_cache) {
if (info.node && info.in_editor) {
get_tree()->get_root()->call_deferred(SNAME("add_child"), info.node);
callable_mp((Node *)get_tree()->get_root(), &Node::add_child).call_deferred(info.node, false, Node::INTERNAL_MODE_DISABLED);
}
}
browse_button->set_icon(get_editor_theme_icon(SNAME("Folder")));
@ -533,7 +533,7 @@ void EditorAutoloadSettings::update_autoload() {
}
if (info.in_editor) {
ERR_CONTINUE(!info.node);
get_tree()->get_root()->call_deferred(SNAME("remove_child"), info.node);
callable_mp((Node *)get_tree()->get_root(), &Node::remove_child).call_deferred(info.node);
}
if (info.node) {

View File

@ -1242,7 +1242,6 @@ void EditorSelection::_bind_methods() {
ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node);
ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::get_selected_nodes);
ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"), &EditorSelection::_get_transformable_selected_nodes);
ClassDB::bind_method(D_METHOD("_emit_change"), &EditorSelection::_emit_change);
ADD_SIGNAL(MethodInfo("selection_changed"));
}
@ -1290,7 +1289,7 @@ void EditorSelection::update() {
changed = false;
if (!emitted) {
emitted = true;
call_deferred(SNAME("_emit_change"));
callable_mp(this, &EditorSelection::_emit_change).call_deferred();
}
}

View File

@ -2693,7 +2693,7 @@ EditorFileSystem::EditorFileSystem() {
using_fat32_or_exfat = (da->get_filesystem_type() == "FAT32" || da->get_filesystem_type() == "exFAT");
scan_total = 0;
MessageQueue::get_singleton()->push_callable(callable_mp(ResourceUID::get_singleton(), &ResourceUID::clear)); // Will be updated on scan.
callable_mp(ResourceUID::get_singleton(), &ResourceUID::clear).call_deferred(); // Will be updated on scan.
ResourceSaver::set_get_resource_id_for_path(_resource_saver_get_resource_id_for_path);
}

View File

@ -1966,7 +1966,7 @@ void EditorHelp::_help_callback(const String &p_topic) {
}
if (class_desc->is_ready()) {
class_desc->call_deferred(SNAME("scroll_to_paragraph"), line);
callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).call_deferred(line);
} else {
scroll_to = line;
}

View File

@ -96,7 +96,7 @@ void EditorHelpSearch::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (!is_visible()) {
results_tree->call_deferred(SNAME("clear")); // Wait for the Tree's mouse event propagation.
callable_mp(results_tree, &Tree::clear).call_deferred(); // Wait for the Tree's mouse event propagation.
get_ok_button()->set_disabled(true);
EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "search_help", Rect2(get_position(), get_size()));
}

View File

@ -695,15 +695,14 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
new_coords.y++;
}
if (new_coords.x < int64_t(object->get("hframes")) && new_coords.y < int64_t(object->get("vframes"))) {
call_deferred(SNAME("emit_changed"), property, new_coords, "", false);
callable_mp(this, &EditorProperty::emit_changed).call_deferred(property, new_coords, "", false);
}
} else {
if (int64_t(object->get(property)) + 1 < (int64_t(object->get("hframes")) * int64_t(object->get("vframes")))) {
call_deferred(SNAME("emit_changed"), property, object->get(property).operator int64_t() + 1, "", false);
callable_mp(this, &EditorProperty::emit_changed).call_deferred(property, object->get(property).operator int64_t() + 1, "", false);
}
}
call_deferred(SNAME("update_property"));
callable_mp(this, &EditorProperty::update_property).call_deferred();
}
}
if (delete_rect.has_point(mpos)) {
@ -3980,7 +3979,7 @@ void EditorInspector::_notification(int p_what) {
case NOTIFICATION_PROCESS: {
if (update_scroll_request >= 0) {
get_v_scroll_bar()->call_deferred(SNAME("set_value"), update_scroll_request);
callable_mp((Range *)get_v_scroll_bar(), &Range::set_value).call_deferred(update_scroll_request);
update_scroll_request = -1;
}
if (update_tree_pending) {

View File

@ -38,7 +38,6 @@
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/class_db.h"
#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/os/time.h"
@ -668,7 +667,7 @@ void EditorNode::_notification(int p_what) {
command_palette->register_shortcuts_as_command();
MessageQueue::get_singleton()->push_callable(callable_mp(this, &EditorNode::_begin_first_scan));
callable_mp(this, &EditorNode::_begin_first_scan).call_deferred();
/* DO NOT LOAD SCENES HERE, WAIT FOR FILE SCANNING AND REIMPORT TO COMPLETE */
} break;
@ -1107,7 +1106,7 @@ void EditorNode::_scan_external_changes() {
}
if (need_reload) {
disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3);
callable_mp((Window *)disk_changed, &Window::popup_centered_ratio).call_deferred(0.3);
}
}
@ -3707,7 +3706,7 @@ void EditorNode::_set_current_scene_nocheck(int p_idx) {
callable_mp(scene_tabs, &EditorSceneTabs::update_scene_tabs).call_deferred();
if (tabs_to_close.is_empty()) {
call_deferred(SNAME("_set_main_scene_state"), state, get_edited_scene()); // Do after everything else is done setting up.
callable_mp(this, &EditorNode::_set_main_scene_state).call_deferred(state, get_edited_scene()); // Do after everything else is done setting up.
}
}
@ -4097,7 +4096,7 @@ bool EditorNode::has_previous_scenes() const {
void EditorNode::edit_foreign_resource(Ref<Resource> p_resource) {
load_scene(p_resource->get_path().get_slice("::", 0));
InspectorDock::get_singleton()->call_deferred("edit_resource", p_resource);
callable_mp(InspectorDock::get_singleton(), &InspectorDock::edit_resource).call_deferred(p_resource);
}
bool EditorNode::is_resource_read_only(Ref<Resource> p_resource, bool p_foreign_resources_are_writable) {
@ -4176,7 +4175,7 @@ void EditorNode::_add_to_recent_scenes(const String &p_scene) {
void EditorNode::_open_recent_scene(int p_idx) {
if (p_idx == recent_scenes->get_item_count() - 1) {
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scenes", Array());
call_deferred(SNAME("_update_recent_scenes"));
callable_mp(this, &EditorNode::_update_recent_scenes).call_deferred();
} else {
Array rc = EditorSettings::get_singleton()->get_project_metadata("recent_files", "scenes", Array());
ERR_FAIL_INDEX(p_idx, rc.size());
@ -5259,7 +5258,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String
int selected_tab_idx = p_layout->get_value(p_section, "dock_" + itos(i + 1) + "_selected_tab_idx");
if (selected_tab_idx >= 0 && selected_tab_idx < dock_slot[i]->get_tab_count()) {
dock_slot[i]->call_deferred("set_current_tab", selected_tab_idx);
callable_mp(dock_slot[i], &TabContainer::set_current_tab).call_deferred(selected_tab_idx);
}
}
@ -6677,15 +6676,9 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("push_item", "object", "property", "inspector_only"), &EditorNode::push_item, DEFVAL(""), DEFVAL(false));
ClassDB::bind_method("set_edited_scene", &EditorNode::set_edited_scene);
ClassDB::bind_method("open_request", &EditorNode::open_request);
ClassDB::bind_method("edit_foreign_resource", &EditorNode::edit_foreign_resource);
ClassDB::bind_method("is_resource_read_only", &EditorNode::is_resource_read_only);
ClassDB::bind_method("stop_child_process", &EditorNode::stop_child_process);
ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state);
ClassDB::bind_method("_update_recent_scenes", &EditorNode::_update_recent_scenes);
ADD_SIGNAL(MethodInfo("request_help_search"));
ADD_SIGNAL(MethodInfo("script_add_function_request", PropertyInfo(Variant::OBJECT, "obj"), PropertyInfo(Variant::STRING, "function"), PropertyInfo(Variant::PACKED_STRING_ARRAY, "args")));
ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "obj")));

View File

@ -402,13 +402,13 @@ void EditorPlugin::remove_translation_parser_plugin(const Ref<EditorTranslationP
void EditorPlugin::add_import_plugin(const Ref<EditorImportPlugin> &p_importer, bool p_first_priority) {
ERR_FAIL_COND(!p_importer.is_valid());
ResourceFormatImporter::get_singleton()->add_importer(p_importer, p_first_priority);
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred();
}
void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importer) {
ERR_FAIL_COND(!p_importer.is_valid());
ResourceFormatImporter::get_singleton()->remove_importer(p_importer);
EditorFileSystem::get_singleton()->call_deferred(SNAME("scan"));
callable_mp(EditorFileSystem::get_singleton(), &EditorFileSystem::scan).call_deferred();
}
void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) {

View File

@ -3013,7 +3013,7 @@ void EditorPropertyResource::_resource_selected(const Ref<Resource> &p_resource,
if (extensions.find(parent.get_extension()) && (!EditorNode::get_singleton()->get_edited_scene() || EditorNode::get_singleton()->get_edited_scene()->get_scene_file_path() != parent)) {
// If the resource belongs to another (non-imported) scene, edit it in that scene instead.
if (!FileAccess::exists(parent + ".import")) {
EditorNode::get_singleton()->call_deferred("edit_foreign_resource", p_resource);
callable_mp(EditorNode::get_singleton(), &EditorNode::edit_foreign_resource).call_deferred(p_resource);
return;
}
}

View File

@ -407,8 +407,8 @@ void EditorPropertyArray::update_property() {
new_prop->connect(SNAME("object_id_selected"), callable_mp(this, &EditorPropertyArray::_object_id_selected));
new_prop->set_h_size_flags(SIZE_EXPAND_FILL);
new_prop->set_read_only(is_read_only());
slot.prop->call_deferred("add_sibling", new_prop);
slot.prop->call_deferred("queue_free");
callable_mp((Node *)slot.prop, &Node::add_sibling).call_deferred(new_prop, false);
callable_mp((Node *)slot.prop, &Node::queue_free).call_deferred();
slot.prop = new_prop;
slot.set_index(idx);
}

View File

@ -34,7 +34,6 @@
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/message_queue.h"
#include "core/variant/variant_utility.h"
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
@ -123,7 +122,7 @@ void EditorResourcePreview::_preview_ready(const String &p_path, int p_hash, con
cache[p_path] = item;
}
MessageQueue::get_singleton()->push_call(id, p_func, p_path, p_texture, p_small_texture, p_ud);
Callable(id, p_func).call_deferred(p_path, p_texture, p_small_texture, p_ud);
}
void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref<ImageTexture> &r_small_texture, const QueueItem &p_item, const String &cache_base, Dictionary &p_metadata) {

View File

@ -901,7 +901,7 @@ Vector<String> EditorExportPlatform::get_forced_export_files() {
if (FileAccess::exists(abs_path)) {
files.push_back(ts_data);
// Remove the file later.
MessageQueue::get_singleton()->push_callable(callable_mp_static(DirAccess::remove_absolute), abs_path);
callable_mp_static(DirAccess::remove_absolute).call_deferred(abs_path);
}
}
}

View File

@ -651,7 +651,7 @@ void FileSystemDock::_notification(int p_what) {
void FileSystemDock::_tree_multi_selected(Object *p_item, int p_column, bool p_selected) {
// Update the import dock.
import_dock_needs_update = true;
call_deferred(SNAME("_update_import_dock"));
callable_mp(this, &FileSystemDock::_update_import_dock).call_deferred();
// Return if we don't select something new.
if (!p_selected) {
@ -3329,7 +3329,7 @@ void FileSystemDock::_file_multi_selected(int p_index, bool p_selected) {
// Update the import dock.
import_dock_needs_update = true;
call_deferred(SNAME("_update_import_dock"));
callable_mp(this, &FileSystemDock::_update_import_dock).call_deferred();
}
void FileSystemDock::_tree_mouse_exited() {
@ -3645,16 +3645,11 @@ MenuButton *FileSystemDock::_create_file_menu_button() {
}
void FileSystemDock::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_tree"), &FileSystemDock::_update_tree);
ClassDB::bind_method(D_METHOD("_file_list_thumbnail_done"), &FileSystemDock::_file_list_thumbnail_done);
ClassDB::bind_method(D_METHOD("_tree_thumbnail_done"), &FileSystemDock::_tree_thumbnail_done);
ClassDB::bind_method(D_METHOD("_select_file"), &FileSystemDock::_select_file);
ClassDB::bind_method(D_METHOD("navigate_to_path", "path"), &FileSystemDock::navigate_to_path);
ClassDB::bind_method(D_METHOD("_update_import_dock"), &FileSystemDock::_update_import_dock);
ClassDB::bind_method(D_METHOD("add_resource_tooltip_plugin", "plugin"), &FileSystemDock::add_resource_tooltip_plugin);
ClassDB::bind_method(D_METHOD("remove_resource_tooltip_plugin", "plugin"), &FileSystemDock::remove_resource_tooltip_plugin);

View File

@ -465,7 +465,7 @@ void FindInFilesDialog::_notification(int p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
// Doesn't work more than once if not deferred...
_search_text_line_edit->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)_search_text_line_edit, &Control::grab_focus).call_deferred();
_search_text_line_edit->select_all();
// Extensions might have changed in the meantime, we clean them and instance them again.
for (int i = 0; i < _filters_container->get_child_count(); i++) {

View File

@ -92,7 +92,7 @@ void EditorSpinSlider::gui_input(const Ref<InputEvent> &p_event) {
}
} else if (mb->get_button_index() == MouseButton::WHEEL_UP || mb->get_button_index() == MouseButton::WHEEL_DOWN) {
if (grabber->is_visible()) {
call_deferred(SNAME("queue_redraw"));
callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw).call_deferred();
}
}
}
@ -637,11 +637,11 @@ void EditorSpinSlider::_focus_entered() {
_ensure_input_popup();
value_input->set_text(get_text_value());
value_input_popup->set_size(get_size());
value_input_popup->call_deferred(SNAME("show"));
value_input->call_deferred(SNAME("grab_focus"));
value_input->call_deferred(SNAME("select_all"));
value_input->set_focus_next(find_next_valid_focus()->get_path());
value_input->set_focus_previous(find_prev_valid_focus()->get_path());
callable_mp((CanvasItem *)value_input_popup, &CanvasItem::show).call_deferred();
callable_mp((Control *)value_input, &Control::grab_focus).call_deferred();
callable_mp(value_input, &LineEdit ::select_all).call_deferred();
emit_signal("value_focus_entered");
}

View File

@ -406,7 +406,7 @@ void EditorToaster::popup_str(String p_message, Severity p_severity, String p_to
// Since "_popup_str" adds nodes to the tree, and since the "add_child" method is not
// thread-safe, it's better to defer the call to the next cycle to be thread-safe.
is_processing_error = true;
call_deferred(SNAME("_popup_str"), p_message, p_severity, p_tooltip);
callable_mp(this, &EditorToaster::_popup_str).call_deferred(p_message, p_severity, p_tooltip);
is_processing_error = false;
}
@ -499,11 +499,6 @@ EditorToaster *EditorToaster::get_singleton() {
return singleton;
}
void EditorToaster::_bind_methods() {
// Binding method to make it defer-able.
ClassDB::bind_method(D_METHOD("_popup_str", "message", "severity", "tooltip"), &EditorToaster::_popup_str);
}
EditorToaster::EditorToaster() {
set_notify_transform(true);
set_process_internal(true);

View File

@ -105,7 +105,6 @@ private:
protected:
static EditorToaster *singleton;
static void _bind_methods();
void _notification(int p_what);

View File

@ -31,7 +31,6 @@
#include "scene_tree_editor.h"
#include "core/config/project_settings.h"
#include "core/object/message_queue.h"
#include "core/object/script_language.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
@ -593,7 +592,7 @@ void SceneTreeEditor::_node_script_changed(Node *p_node) {
return;
}
MessageQueue::get_singleton()->push_call(this, "_update_tree");
callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
tree_dirty = true;
}
@ -626,7 +625,7 @@ void SceneTreeEditor::_node_renamed(Node *p_node) {
emit_signal(SNAME("node_renamed"));
if (!tree_dirty) {
MessageQueue::get_singleton()->push_call(this, "_update_tree");
callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
tree_dirty = true;
}
}
@ -843,12 +842,12 @@ void SceneTreeEditor::_test_update_tree() {
return; // did not change
}
MessageQueue::get_singleton()->push_call(this, "_update_tree");
callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
tree_dirty = true;
}
void SceneTreeEditor::_tree_process_mode_changed() {
MessageQueue::get_singleton()->push_call(this, "_update_tree");
callable_mp(this, &SceneTreeEditor::_update_tree).call_deferred(false);
tree_dirty = true;
}
@ -863,7 +862,7 @@ void SceneTreeEditor::_tree_changed() {
return;
}
MessageQueue::get_singleton()->push_call(this, "_test_update_tree");
callable_mp(this, &SceneTreeEditor::_test_update_tree).call_deferred();
pending_test_update = true;
}
@ -1484,7 +1483,6 @@ void SceneTreeEditor::set_connecting_signal(bool p_enable) {
void SceneTreeEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_tree"), &SceneTreeEditor::_update_tree, DEFVAL(false)); // Still used by UndoRedo.
ClassDB::bind_method("_rename_node", &SceneTreeEditor::_rename_node);
ClassDB::bind_method("_test_update_tree", &SceneTreeEditor::_test_update_tree);
ClassDB::bind_method(D_METHOD("update_tree"), &SceneTreeEditor::update_tree);
@ -1642,7 +1640,7 @@ void SceneTreeDialog::_notification(int p_what) {
tree->update_tree();
// Select the search bar by default.
filter->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)filter, &Control::grab_focus).call_deferred();
}
} break;

View File

@ -461,15 +461,6 @@ void InspectorDock::_notification(int p_what) {
}
void InspectorDock::_bind_methods() {
ClassDB::bind_method("_unref_resource", &InspectorDock::_unref_resource);
ClassDB::bind_method("_paste_resource", &InspectorDock::_paste_resource);
ClassDB::bind_method("_copy_resource", &InspectorDock::_copy_resource);
ClassDB::bind_method("_menu_collapseall", &InspectorDock::_menu_collapseall);
ClassDB::bind_method("_menu_expandall", &InspectorDock::_menu_expandall);
ClassDB::bind_method("edit_resource", &InspectorDock::edit_resource);
ClassDB::bind_method("store_script_properties", &InspectorDock::store_script_properties);
ClassDB::bind_method("apply_script_properties", &InspectorDock::apply_script_properties);

View File

@ -189,7 +189,7 @@ void LocalizationEditor::_translation_res_select() {
if (updating_translations) {
return;
}
call_deferred(SNAME("update_translations"));
callable_mp(this, &LocalizationEditor::update_translations).call_deferred();
}
void LocalizationEditor::_translation_res_option_popup(bool p_arrow_clicked) {

View File

@ -2139,7 +2139,7 @@ void AnimationPlayerEditorPlugin::_clear_dummy_player() {
}
Node *parent = dummy_player->get_parent();
if (parent) {
parent->call_deferred("remove_child", dummy_player);
callable_mp(parent, &Node::remove_child).call_deferred(dummy_player);
}
dummy_player->queue_free();
dummy_player = nullptr;

View File

@ -203,7 +203,7 @@ void AnimationNodeStateMachineEditor::_state_machine_gui_input(const Ref<InputEv
}
if (node_rects[i].edit.has_point(mb->get_position())) { //edit name
call_deferred(SNAME("_open_editor"), node_rects[i].node_name);
callable_mp(this, &AnimationNodeStateMachineEditor::_open_editor).call_deferred(node_rects[i].node_name);
return;
}
@ -1610,12 +1610,6 @@ void AnimationNodeStateMachineEditor::_update_mode() {
void AnimationNodeStateMachineEditor::_bind_methods() {
ClassDB::bind_method("_update_graph", &AnimationNodeStateMachineEditor::_update_graph);
ClassDB::bind_method("_open_editor", &AnimationNodeStateMachineEditor::_open_editor);
ClassDB::bind_method("_connect_to", &AnimationNodeStateMachineEditor::_connect_to);
ClassDB::bind_method("_stop_connecting", &AnimationNodeStateMachineEditor::_stop_connecting);
ClassDB::bind_method("_delete_selected", &AnimationNodeStateMachineEditor::_delete_selected);
ClassDB::bind_method("_delete_all", &AnimationNodeStateMachineEditor::_delete_all);
ClassDB::bind_method("_delete_tree_draw", &AnimationNodeStateMachineEditor::_delete_tree_draw);
BIND_THEME_ITEM_EXT(Theme::DATA_TYPE_STYLEBOX, AnimationNodeStateMachineEditor, panel_style, "panel", "GraphStateMachine");
BIND_THEME_ITEM_EXT(Theme::DATA_TYPE_STYLEBOX, AnimationNodeStateMachineEditor, error_panel_style, "error_panel", "GraphStateMachine");

View File

@ -976,7 +976,7 @@ void CanvasItemEditor::_node_created(Node *p_node) {
c->_edit_set_position(xform.xform(node_create_position));
}
call_deferred(SNAME("_reset_create_position")); // Defer the call in case more than one node is added.
callable_mp(this, &CanvasItemEditor::_reset_create_position).call_deferred(); // Defer the call in case more than one node is added.
}
void CanvasItemEditor::_reset_create_position() {
@ -2610,7 +2610,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
// Grab focus
if (!viewport->has_focus() && (!get_viewport()->gui_get_focus_owner() || !get_viewport()->gui_get_focus_owner()->is_text_field())) {
viewport->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)viewport, &Control::grab_focus).call_deferred();
}
}
@ -3911,6 +3911,11 @@ void CanvasItemEditor::_update_editor_settings() {
void CanvasItemEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
EditorRunBar::get_singleton()->connect("play_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(true));
EditorRunBar::get_singleton()->connect("stop_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(false));
} break;
case NOTIFICATION_PHYSICS_PROCESS: {
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET("gui/common/snap_controls_to_pixels"));
@ -4723,7 +4728,7 @@ void CanvasItemEditor::_focus_selection(int p_op) {
zoom *= 0.90;
zoom_widget->set_zoom(zoom);
viewport->queue_redraw(); // Redraw to update the global canvas transform after zoom changes.
call_deferred(SNAME("center_at"), rect.get_center()); // Defer because the updated transform is needed.
callable_mp(this, &CanvasItemEditor::center_at).call_deferred(rect.get_center()); // Defer because the updated transform is needed.
} else {
center_at(rect.get_center());
}
@ -5080,9 +5085,6 @@ CanvasItemEditor::CanvasItemEditor() {
SceneTreeDock::get_singleton()->connect("node_created", callable_mp(this, &CanvasItemEditor::_node_created));
SceneTreeDock::get_singleton()->connect("add_node_used", callable_mp(this, &CanvasItemEditor::_reset_create_position));
EditorRunBar::get_singleton()->call_deferred(SNAME("connect"), "play_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(true));
EditorRunBar::get_singleton()->call_deferred(SNAME("connect"), "stop_pressed", callable_mp(this, &CanvasItemEditor::_update_override_camera_button).bind(false));
// Add some margin to the sides for better esthetics.
// This prevents the first button's hover/pressed effect from "touching" the panel's border,
// which looks ugly.

View File

@ -284,7 +284,7 @@ Joint3DGizmoPlugin::Joint3DGizmoPlugin() {
update_timer->set_wait_time(1.0 / 120.0);
update_timer->connect("timeout", callable_mp(this, &Joint3DGizmoPlugin::incremental_update_gizmos));
update_timer->set_autostart(true);
EditorNode::get_singleton()->call_deferred(SNAME("add_child"), update_timer);
callable_mp((Node *)EditorNode::get_singleton(), &Node::add_child).call_deferred(update_timer, false, Node::INTERNAL_MODE_DISABLED);
}
void Joint3DGizmoPlugin::incremental_update_gizmos() {

View File

@ -2734,11 +2734,11 @@ void Node3DEditorViewport::_notification(int p_what) {
} else {
set_freelook_active(false);
}
call_deferred(SNAME("update_transform_gizmo_view"));
callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view).call_deferred();
} break;
case NOTIFICATION_RESIZED: {
call_deferred(SNAME("update_transform_gizmo_view"));
callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view).call_deferred();
} break;
case NOTIFICATION_PROCESS: {
@ -3355,7 +3355,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL), false);
orthogonal = false;
auto_orthogonal = false;
call_deferred(SNAME("update_transform_gizmo_view"));
callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view).call_deferred();
_update_camera(0);
_update_name();
@ -3365,7 +3365,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ORTHOGONAL), true);
orthogonal = true;
auto_orthogonal = false;
call_deferred(SNAME("update_transform_gizmo_view"));
callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view).call_deferred();
_update_camera(0);
_update_name();
} break;
@ -3985,8 +3985,6 @@ Dictionary Node3DEditorViewport::get_state() const {
}
void Node3DEditorViewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &Node3DEditorViewport::update_transform_gizmo_view); // Used by call_deferred.
ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport")));
ADD_SIGNAL(MethodInfo("clicked", PropertyInfo(Variant::OBJECT, "viewport")));
}

View File

@ -733,7 +733,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
// clear button
if (p_idx == recent_scripts->get_item_count() - 1) {
EditorSettings::get_singleton()->set_project_metadata("recent_files", "scripts", Array());
call_deferred(SNAME("_update_recent_scripts"));
callable_mp(this, &ScriptEditor::_update_recent_scripts).call_deferred();
return;
}
@ -1031,7 +1031,7 @@ void ScriptEditor::_scene_saved_callback(const String &p_path) {
void ScriptEditor::trigger_live_script_reload() {
if (!pending_auto_reload && auto_reload_running_scripts) {
call_deferred(SNAME("_live_auto_reload_running_scripts"));
callable_mp(this, &ScriptEditor::_live_auto_reload_running_scripts).call_deferred();
pending_auto_reload = true;
}
}
@ -1082,7 +1082,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref<Resource> p_for_script) {
script_editor->reload_scripts();
need_reload = false;
} else {
disk_changed->call_deferred(SNAME("popup_centered_ratio"), 0.3);
callable_mp((Window *)disk_changed, &Window::popup_centered_ratio).call_deferred(0.3);
}
}
@ -2873,7 +2873,7 @@ void ScriptEditor::_tree_changed() {
}
waiting_update_names = true;
call_deferred(SNAME("_update_script_names"));
callable_mp(this, &ScriptEditor::_update_script_names).call_deferred();
}
void ScriptEditor::_split_dragged(float) {
@ -3393,7 +3393,7 @@ void ScriptEditor::_help_class_goto(const String &p_desc) {
_update_script_names();
_save_layout();
call_deferred("_help_tab_goto", cname, p_desc);
callable_mp(this, &ScriptEditor::_help_tab_goto).call_deferred(cname, p_desc);
}
bool ScriptEditor::_help_tab_goto(const String &p_name, const String &p_desc) {
@ -3791,18 +3791,7 @@ void ScriptEditor::_filter_methods_text_changed(const String &p_newtext) {
}
void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab);
ClassDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs);
ClassDB::bind_method("_close_other_tabs", &ScriptEditor::_close_other_tabs);
ClassDB::bind_method("_goto_script_line2", &ScriptEditor::_goto_script_line2);
ClassDB::bind_method("_copy_script_path", &ScriptEditor::_copy_script_path);
ClassDB::bind_method("_help_class_open", &ScriptEditor::_help_class_open);
ClassDB::bind_method("_help_tab_goto", &ScriptEditor::_help_tab_goto);
ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts);
ClassDB::bind_method("_update_members_overview", &ScriptEditor::_update_members_overview);
ClassDB::bind_method("_update_recent_scripts", &ScriptEditor::_update_recent_scripts);
ClassDB::bind_method("get_current_editor", &ScriptEditor::_get_current_editor);
ClassDB::bind_method("get_open_script_editors", &ScriptEditor::_get_open_script_editors);

View File

@ -886,7 +886,7 @@ void ScriptTextEditor::_breakpoint_item_pressed(int p_idx) {
_edit_option(breakpoints_menu->get_item_id(p_idx));
} else {
code_editor->goto_line(breakpoints_menu->get_item_metadata(p_idx));
code_editor->get_text_editor()->call_deferred(SNAME("center_viewport_to_caret")); //Need to be deferred, because goto uses call_deferred().
callable_mp((TextEdit *)code_editor->get_text_editor(), &TextEdit::center_viewport_to_caret).call_deferred(0); // Needs to be deferred, because goto uses call_deferred().
}
}
@ -1273,27 +1273,27 @@ void ScriptTextEditor::_edit_option(int p_op) {
switch (p_op) {
case EDIT_UNDO: {
tx->undo();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_REDO: {
tx->redo();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_CUT: {
tx->cut();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_COPY: {
tx->copy();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_PASTE: {
tx->paste();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_SELECT_ALL: {
tx->select_all();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_MOVE_LINE_UP: {
code_editor->move_lines_up();

View File

@ -602,6 +602,7 @@ void ShaderEditorPlugin::_file_removed(const String &p_removed_file) {
void ShaderEditorPlugin::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
EditorNode::get_singleton()->connect("resource_saved", callable_mp(this, &ShaderEditorPlugin::_resource_saved), CONNECT_DEFERRED);
EditorNode::get_singleton()->connect("scene_closed", callable_mp(this, &ShaderEditorPlugin::_close_builtin_shaders_from_scene));
FileSystemDock::get_singleton()->connect("file_removed", callable_mp(this, &ShaderEditorPlugin::_file_removed));
} break;
@ -677,9 +678,6 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Shader Editor"), window_wrapper);
// Defer connect because Editor class is not in the binding system yet.
EditorNode::get_singleton()->call_deferred("connect", "resource_saved", callable_mp(this, &ShaderEditorPlugin::_resource_saved), CONNECT_DEFERRED);
shader_create_dialog = memnew(ShaderCreateDialog);
vb->add_child(shader_create_dialog);
shader_create_dialog->connect("shader_created", callable_mp(this, &ShaderEditorPlugin::_shader_created));

View File

@ -889,18 +889,6 @@ void Skeleton3DEditor::_node_removed(Node *p_node) {
_update_properties();
}
void Skeleton3DEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_node_removed"), &Skeleton3DEditor::_node_removed);
ClassDB::bind_method(D_METHOD("_joint_tree_selection_changed"), &Skeleton3DEditor::_joint_tree_selection_changed);
ClassDB::bind_method(D_METHOD("_joint_tree_rmb_select"), &Skeleton3DEditor::_joint_tree_rmb_select);
ClassDB::bind_method(D_METHOD("_update_properties"), &Skeleton3DEditor::_update_properties);
ClassDB::bind_method(D_METHOD("_on_click_skeleton_option"), &Skeleton3DEditor::_on_click_skeleton_option);
ClassDB::bind_method(D_METHOD("move_skeleton_bone"), &Skeleton3DEditor::move_skeleton_bone);
ClassDB::bind_method(D_METHOD("_draw_gizmo"), &Skeleton3DEditor::_draw_gizmo);
}
void Skeleton3DEditor::edit_mode_toggled(const bool pressed) {
edit_mode = pressed;
_update_gizmo_visible();

View File

@ -198,7 +198,6 @@ class Skeleton3DEditor : public VBoxContainer {
protected:
void _notification(int p_what);
void _node_removed(Node *p_node);
static void _bind_methods();
public:
static Skeleton3DEditor *get_singleton() { return singleton; }

View File

@ -352,27 +352,27 @@ void TextEditor::_edit_option(int p_op) {
switch (p_op) {
case EDIT_UNDO: {
tx->undo();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_REDO: {
tx->redo();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_CUT: {
tx->cut();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_COPY: {
tx->copy();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_PASTE: {
tx->paste();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_SELECT_ALL: {
tx->select_all();
tx->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_MOVE_LINE_UP: {
code_editor->move_lines_up();

View File

@ -170,8 +170,8 @@ void ShaderTextEditor::set_edited_code(const String &p_code) {
get_text_editor()->set_text(p_code);
get_text_editor()->clear_undo_history();
get_text_editor()->call_deferred(SNAME("set_h_scroll"), 0);
get_text_editor()->call_deferred(SNAME("set_v_scroll"), 0);
callable_mp((TextEdit *)get_text_editor(), &TextEdit::set_h_scroll).call_deferred(0);
callable_mp((TextEdit *)get_text_editor(), &TextEdit::set_v_scroll).call_deferred(0);
get_text_editor()->tag_saved_version();
_validate_script();
@ -719,7 +719,7 @@ void TextShaderEditor::_menu_option(int p_option) {
} break;
}
if (p_option != SEARCH_FIND && p_option != SEARCH_REPLACE && p_option != SEARCH_GOTO_LINE) {
shader_editor->get_text_editor()->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)shader_editor->get_text_editor(), &Control::grab_focus).call_deferred();
}
}
@ -820,7 +820,7 @@ void TextShaderEditor::_check_for_external_edit() {
if (use_autoreload) {
_reload_shader_include_from_disk();
} else {
disk_changed->call_deferred(SNAME("popup_centered"));
callable_mp((Window *)disk_changed, &Window::popup_centered).call_deferred(Size2i());
}
}
return;
@ -834,7 +834,7 @@ void TextShaderEditor::_check_for_external_edit() {
if (use_autoreload) {
_reload_shader_from_disk();
} else {
disk_changed->call_deferred(SNAME("popup_centered"));
callable_mp((Window *)disk_changed, &Window::popup_centered).call_deferred(Size2i());
}
}
}

View File

@ -53,7 +53,7 @@
void TileDataEditor::_tile_set_changed_plan_update() {
_tile_set_changed_update_needed = true;
call_deferred(SNAME("_tile_set_changed_deferred_update"));
callable_mp(this, &TileDataEditor::_tile_set_changed_deferred_update).call_deferred();
}
void TileDataEditor::_tile_set_changed_deferred_update() {
@ -80,8 +80,6 @@ TileData *TileDataEditor::_get_tile_data(TileMapCell p_cell) {
}
void TileDataEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_tile_set_changed_deferred_update"), &TileDataEditor::_tile_set_changed_deferred_update);
ADD_SIGNAL(MethodInfo("needs_redraw"));
}

View File

@ -954,7 +954,7 @@ void TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_pressed() {
}
void TileSetAtlasSourceEditor::_tile_data_editors_tree_selected() {
tile_data_editors_popup->call_deferred(SNAME("hide"));
callable_mp((Window *)tile_data_editors_popup, &Window::hide).call_deferred();
_update_current_tile_data_editor();
tile_atlas_control->queue_redraw();
tile_atlas_control_unscaled->queue_redraw();

View File

@ -125,7 +125,7 @@ void TilesEditorUtils::_thread() {
tile_map->set_position(-(scale * encompassing_rect.get_center()) + thumbnail_size2 / 2);
// Add the viewport at the last moment to avoid rendering too early.
EditorNode::get_singleton()->call_deferred("add_child", viewport);
callable_mp((Node *)EditorNode::get_singleton(), &Node::add_child).call_deferred(viewport, false, Node::INTERNAL_MODE_DISABLED);
RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<TilesEditorUtils *>(this), &TilesEditorUtils::_preview_frame_started), Object::CONNECT_ONE_SHOT);

View File

@ -182,7 +182,7 @@ void VisualShaderGraphPlugin::show_port_preview(VisualShader::Type p_type, int p
}
void VisualShaderGraphPlugin::update_node_deferred(VisualShader::Type p_type, int p_node_id) {
call_deferred(SNAME("update_node"), p_type, p_node_id);
callable_mp(this, &VisualShaderGraphPlugin::update_node).call_deferred(p_type, p_node_id);
}
void VisualShaderGraphPlugin::update_node(VisualShader::Type p_type, int p_node_id) {
@ -1492,14 +1492,14 @@ void VisualShaderEditor::_update_custom_script(const Ref<Script> &p_script) {
if (!_block_update_options_menu) {
_block_update_options_menu = true;
call_deferred(SNAME("_update_options_menu_deferred"));
callable_mp(this, &VisualShaderEditor::_update_options_menu_deferred);
}
// To prevent rebuilding the shader multiple times when multiple scripts are saved.
if (need_rebuild && !_block_rebuild_shader) {
_block_rebuild_shader = true;
call_deferred(SNAME("_rebuild_shader_deferred"));
callable_mp(this, &VisualShaderEditor::_rebuild_shader_deferred);
}
}
@ -1581,8 +1581,7 @@ void VisualShaderEditor::_resource_removed(const Ref<Resource> &p_resource) {
if (!pending_custom_scripts_to_delete) {
pending_custom_scripts_to_delete = true;
call_deferred("_resources_removed");
callable_mp(this, &VisualShaderEditor::_resources_removed).call_deferred();
}
}
@ -3322,11 +3321,11 @@ void VisualShaderEditor::_add_node(int p_idx, const Vector<Variant> &p_ops, Stri
}
if (is_curve) {
graph_plugin->call_deferred(SNAME("update_curve"), id_to_use);
callable_mp(graph_plugin.ptr(), &VisualShaderGraphPlugin::update_curve).call_deferred(id_to_use);
}
if (is_curve_xyz) {
graph_plugin->call_deferred(SNAME("update_curve_xyz"), id_to_use);
callable_mp(graph_plugin.ptr(), &VisualShaderGraphPlugin::update_curve_xyz).call_deferred(id_to_use);
}
if (p_resource_path.is_empty()) {
@ -3466,7 +3465,7 @@ void VisualShaderEditor::_node_dragged(const Vector2 &p_from, const Vector2 &p_t
VisualShader::Type type = get_current_shader_type();
drag_buffer.push_back({ type, p_node, p_from, p_to });
if (!drag_dirty) {
call_deferred(SNAME("_nodes_dragged"));
callable_mp(this, &VisualShaderEditor::_nodes_dragged).call_deferred();
}
drag_dirty = true;
}
@ -4094,7 +4093,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod
Vector2 difference = (dialog_rect.get_end() - window_rect.get_end()).max(Vector2());
members_dialog->set_position(members_dialog->get_position() - difference);
node_filter->call_deferred(SNAME("grab_focus")); // Still not visible.
callable_mp((Control *)node_filter, &Control::grab_focus).call_deferred(); // Still not visible.
node_filter->select_all();
}
@ -5187,28 +5186,17 @@ void VisualShaderEditor::_visibility_changed() {
void VisualShaderEditor::_bind_methods() {
ClassDB::bind_method("_update_nodes", &VisualShaderEditor::_update_nodes);
ClassDB::bind_method("_update_graph", &VisualShaderEditor::_update_graph);
ClassDB::bind_method("_add_node", &VisualShaderEditor::_add_node);
ClassDB::bind_method("_node_changed", &VisualShaderEditor::_node_changed);
ClassDB::bind_method("_input_select_item", &VisualShaderEditor::_input_select_item);
ClassDB::bind_method("_parameter_ref_select_item", &VisualShaderEditor::_parameter_ref_select_item);
ClassDB::bind_method("_varying_select_item", &VisualShaderEditor::_varying_select_item);
ClassDB::bind_method("_set_node_size", &VisualShaderEditor::_set_node_size);
ClassDB::bind_method("_clear_copy_buffer", &VisualShaderEditor::_clear_copy_buffer);
ClassDB::bind_method("_update_parameters", &VisualShaderEditor::_update_parameters);
ClassDB::bind_method("_update_varyings", &VisualShaderEditor::_update_varyings);
ClassDB::bind_method("_update_varying_tree", &VisualShaderEditor::_update_varying_tree);
ClassDB::bind_method("_set_mode", &VisualShaderEditor::_set_mode);
ClassDB::bind_method("_nodes_dragged", &VisualShaderEditor::_nodes_dragged);
ClassDB::bind_method("_float_constant_selected", &VisualShaderEditor::_float_constant_selected);
ClassDB::bind_method("_update_constant", &VisualShaderEditor::_update_constant);
ClassDB::bind_method("_update_parameter", &VisualShaderEditor::_update_parameter);
ClassDB::bind_method("_expand_output_port", &VisualShaderEditor::_expand_output_port);
ClassDB::bind_method("_update_options_menu_deferred", &VisualShaderEditor::_update_options_menu_deferred);
ClassDB::bind_method("_rebuild_shader_deferred", &VisualShaderEditor::_rebuild_shader_deferred);
ClassDB::bind_method("_resources_removed", &VisualShaderEditor::_resources_removed);
ClassDB::bind_method("_update_next_previews", &VisualShaderEditor::_update_next_previews);
ClassDB::bind_method("_is_available", &VisualShaderEditor::_is_available);
}
VisualShaderEditor::VisualShaderEditor() {

View File

@ -30,7 +30,6 @@
#include "progress_dialog.h"
#include "core/object/message_queue.h"
#include "core/os/os.h"
#include "editor/editor_interface.h"
#include "editor/editor_node.h"
@ -97,15 +96,8 @@ void BackgroundProgress::_end_task(const String &p_task) {
tasks.erase(p_task);
}
void BackgroundProgress::_bind_methods() {
ClassDB::bind_method("_add_task", &BackgroundProgress::_add_task);
ClassDB::bind_method("_task_step", &BackgroundProgress::_task_step);
ClassDB::bind_method("_end_task", &BackgroundProgress::_end_task);
ClassDB::bind_method("_update", &BackgroundProgress::_update);
}
void BackgroundProgress::add_task(const String &p_task, const String &p_label, int p_steps) {
MessageQueue::get_singleton()->push_call(this, "_add_task", p_task, p_label, p_steps);
callable_mp(this, &BackgroundProgress::_add_task).call_deferred(p_task, p_label, p_steps);
}
void BackgroundProgress::task_step(const String &p_task, int p_step) {
@ -117,7 +109,7 @@ void BackgroundProgress::task_step(const String &p_task, int p_step) {
}
if (no_updates) {
MessageQueue::get_singleton()->push_call(this, "_update");
callable_mp(this, &BackgroundProgress::_update).call_deferred();
}
{
@ -127,7 +119,7 @@ void BackgroundProgress::task_step(const String &p_task, int p_step) {
}
void BackgroundProgress::end_task(const String &p_task) {
MessageQueue::get_singleton()->push_call(this, "_end_task", p_task);
callable_mp(this, &BackgroundProgress::_end_task).call_deferred(p_task);
}
////////////////////////////////////////////////
@ -242,9 +234,6 @@ void ProgressDialog::_cancel_pressed() {
canceled = true;
}
void ProgressDialog::_bind_methods() {
}
ProgressDialog::ProgressDialog() {
main = memnew(VBoxContainer);
add_child(main);

View File

@ -56,8 +56,6 @@ protected:
void _task_step(const String &p_task, int p_step = -1);
void _end_task(const String &p_task);
static void _bind_methods();
public:
void add_task(const String &p_task, const String &p_label, int p_steps);
void task_step(const String &p_task, int p_step = -1);
@ -89,9 +87,6 @@ class ProgressDialog : public PopupPanel {
void _cancel_pressed();
bool canceled = false;
protected:
static void _bind_methods();
public:
static ProgressDialog *get_singleton() { return singleton; }
void add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel = false);

View File

@ -321,9 +321,9 @@ void ProjectDialog::_file_selected(const String &p_path) {
project_path->set_text(sp);
_update_path(sp);
if (p.ends_with(".zip")) {
install_path->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)install_path, &Control::grab_focus).call_deferred();
} else {
get_ok_button()->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)get_ok_button(), &Control::grab_focus).call_deferred();
}
}
@ -334,14 +334,14 @@ void ProjectDialog::_path_selected(const String &p_path) {
String sp = p_path.simplify_path();
project_path->set_text(sp);
_update_path(sp);
get_ok_button()->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)get_ok_button(), &Control::grab_focus).call_deferred();
}
void ProjectDialog::_install_path_selected(const String &p_path) {
String sp = p_path.simplify_path();
install_path->set_text(sp);
_update_path(sp);
get_ok_button()->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)get_ok_button(), &Control::grab_focus).call_deferred();
}
void ProjectDialog::_browse_path() {
@ -726,7 +726,7 @@ void ProjectDialog::show_dialog() {
_text_changed(cur_name);
}
project_name->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)project_name, &Control::grab_focus).call_deferred();
create_dir->hide();
@ -773,8 +773,8 @@ void ProjectDialog::show_dialog() {
install_path_container->hide();
renderer_container->show();
default_files_container->show();
project_name->call_deferred(SNAME("grab_focus"));
project_name->call_deferred(SNAME("select_all"));
callable_mp((Control *)project_name, &Control::grab_focus).call_deferred();
callable_mp(project_name, &LineEdit::select_all).call_deferred();
} else if (mode == MODE_INSTALL) {
set_title(TTR("Install Project:") + " " + zip_title);

View File

@ -214,7 +214,6 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "_set_current", "set_current" }, // Camera2D
{ "_set_editor_description", "set_editor_description" }, // Node
{ "_toplevel_raise_self", "_top_level_raise_self" }, // CanvasItem
{ "_update_wrap_at", "_update_wrap_at_column" }, // TextEdit
{ "add_animation", "add_animation_library" }, // AnimationPlayer
{ "add_cancel", "add_cancel_button" }, // AcceptDialog
{ "add_central_force", "apply_central_force" }, //RigidBody2D

View File

@ -65,7 +65,7 @@ void SceneCreateDialog::config(const String &p_dir) {
directory = p_dir;
root_name_edit->set_text("");
scene_name_edit->set_text("");
scene_name_edit->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)scene_name_edit, &Control::grab_focus).call_deferred();
validation_panel->update();
}

View File

@ -34,7 +34,6 @@
#include "core/input/input.h"
#include "core/io/resource_saver.h"
#include "core/object/class_db.h"
#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_feature_profile.h"
@ -4078,7 +4077,7 @@ SceneTreeDock *SceneTreeDock::singleton = nullptr;
void SceneTreeDock::_update_configuration_warning() {
if (singleton) {
MessageQueue::get_singleton()->push_callable(callable_mp(singleton->scene_tree, &SceneTreeEditor::update_warning));
callable_mp(singleton->scene_tree, &SceneTreeEditor::update_warning).call_deferred();
}
}

View File

@ -105,7 +105,6 @@ class ShaderGlobalsEditorInterface : public Object {
protected:
static void _bind_methods() {
ClassDB::bind_method("_set_var", &ShaderGlobalsEditorInterface::_set_var);
ClassDB::bind_method("_var_changed", &ShaderGlobalsEditorInterface::_var_changed);
ADD_SIGNAL(MethodInfo("var_changed"));
}
@ -117,7 +116,7 @@ protected:
return false;
}
call_deferred("_set_var", p_name, p_value, existing);
callable_mp(this, &ShaderGlobalsEditorInterface::_set_var).call_deferred(p_name, p_value, existing);
return true;
}

View File

@ -106,7 +106,7 @@ void SurfaceUpgradeTool::prepare_upgrade() {
EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "resave_paths", resave_paths);
// Delay to avoid deadlocks, since this dialog can be triggered by loading a scene.
MessageQueue::get_singleton()->push_callable(callable_mp(EditorNode::get_singleton(), &EditorNode::restart_editor));
callable_mp(EditorNode::get_singleton(), &EditorNode::restart_editor).call_deferred();
}
// Ensure that the warnings and popups are skipped.

View File

@ -30,7 +30,6 @@
#include "performance.h"
#include "core/object/message_queue.h"
#include "core/os/os.h"
#include "core/variant/typed_array.h"
#include "scene/main/node.h"

View File

@ -150,13 +150,13 @@ float CSGShape3D::get_snap() const {
void CSGShape3D::_make_dirty(bool p_parent_removing) {
if ((p_parent_removing || is_root_shape()) && !dirty) {
call_deferred(SNAME("_update_shape")); // Must be deferred; otherwise, is_root_shape() will use the previous parent
callable_mp(this, &CSGShape3D::_update_shape).call_deferred(); // Must be deferred; otherwise, is_root_shape() will use the previous parent.
}
if (!is_root_shape()) {
parent_shape->_make_dirty();
} else if (!dirty) {
call_deferred(SNAME("_update_shape"));
callable_mp(this, &CSGShape3D::_update_shape).call_deferred();
}
dirty = true;

View File

@ -456,7 +456,7 @@ Variant GDScriptTextDocument::declaration(const Dictionary &p_params) {
id = "class_global:" + symbol->native_class + ":" + symbol->name;
break;
}
call_deferred(SNAME("show_native_symbol_in_editor"), id);
callable_mp(this, &GDScriptTextDocument::show_native_symbol_in_editor).call_deferred(id);
} else {
notify_client_show_symbol(symbol);
}

View File

@ -32,7 +32,6 @@
#include "core/core_string_names.h"
#include "core/io/marshalls.h"
#include "core/object/message_queue.h"
#include "scene/3d/light_3d.h"
#include "scene/resources/mesh_library.h"
#include "scene/resources/physics_material.h"
@ -975,7 +974,7 @@ void GridMap::_queue_octants_dirty() {
return;
}
MessageQueue::get_singleton()->push_call(this, "_update_octants_callback");
callable_mp(this, &GridMap::_update_octants_callback).call_deferred();
awaiting_update = true;
}
@ -1082,7 +1081,6 @@ void GridMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("local_to_map", "local_position"), &GridMap::local_to_map);
ClassDB::bind_method(D_METHOD("map_to_local", "map_position"), &GridMap::map_to_local);
ClassDB::bind_method(D_METHOD("_update_octants_callback"), &GridMap::_update_octants_callback);
#ifndef DISABLE_DEPRECATED
ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &GridMap::resource_changed);
#endif

View File

@ -49,10 +49,6 @@ NoiseTexture2D::~NoiseTexture2D() {
}
void NoiseTexture2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_texture"), &NoiseTexture2D::_update_texture);
ClassDB::bind_method(D_METHOD("_generate_texture"), &NoiseTexture2D::_generate_texture);
ClassDB::bind_method(D_METHOD("_thread_done", "image"), &NoiseTexture2D::_thread_done);
ClassDB::bind_method(D_METHOD("set_width", "width"), &NoiseTexture2D::set_width);
ClassDB::bind_method(D_METHOD("set_height", "height"), &NoiseTexture2D::set_height);
@ -138,7 +134,7 @@ void NoiseTexture2D::_thread_done(const Ref<Image> &p_image) {
void NoiseTexture2D::_thread_function(void *p_ud) {
NoiseTexture2D *tex = static_cast<NoiseTexture2D *>(p_ud);
tex->call_deferred(SNAME("_thread_done"), tex->_generate_texture());
callable_mp(tex, &NoiseTexture2D::_thread_done).call_deferred(tex->_generate_texture());
}
void NoiseTexture2D::_queue_update() {
@ -147,7 +143,7 @@ void NoiseTexture2D::_queue_update() {
}
update_queued = true;
call_deferred(SNAME("_update_texture"));
callable_mp(this, &NoiseTexture2D::_update_texture).call_deferred();
}
Ref<Image> NoiseTexture2D::_generate_texture() {

View File

@ -49,10 +49,6 @@ NoiseTexture3D::~NoiseTexture3D() {
}
void NoiseTexture3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_texture"), &NoiseTexture3D::_update_texture);
ClassDB::bind_method(D_METHOD("_generate_texture"), &NoiseTexture3D::_generate_texture);
ClassDB::bind_method(D_METHOD("_thread_done", "image"), &NoiseTexture3D::_thread_done);
ClassDB::bind_method(D_METHOD("set_width", "width"), &NoiseTexture3D::set_width);
ClassDB::bind_method(D_METHOD("set_height", "height"), &NoiseTexture3D::set_height);
ClassDB::bind_method(D_METHOD("set_depth", "depth"), &NoiseTexture3D::set_depth);
@ -126,7 +122,7 @@ void NoiseTexture3D::_thread_done(const TypedArray<Image> &p_data) {
void NoiseTexture3D::_thread_function(void *p_ud) {
NoiseTexture3D *tex = static_cast<NoiseTexture3D *>(p_ud);
tex->call_deferred(SNAME("_thread_done"), tex->_generate_texture());
callable_mp(tex, &NoiseTexture3D::_thread_done).call_deferred(tex->_generate_texture());
}
void NoiseTexture3D::_queue_update() {
@ -135,7 +131,7 @@ void NoiseTexture3D::_queue_update() {
}
update_queued = true;
call_deferred(SNAME("_update_texture"));
callable_mp(this, &NoiseTexture3D::_update_texture).call_deferred();
}
TypedArray<Image> NoiseTexture3D::_generate_texture() {

View File

@ -43,7 +43,6 @@ void OpenXRActionMapEditor::_bind_methods() {
ClassDB::bind_method("_add_interaction_profile_editor", &OpenXRActionMapEditor::_add_interaction_profile_editor);
ClassDB::bind_method(D_METHOD("_add_action_set", "name"), &OpenXRActionMapEditor::_add_action_set);
ClassDB::bind_method(D_METHOD("_set_focus_on_action_set", "action_set"), &OpenXRActionMapEditor::_set_focus_on_action_set);
ClassDB::bind_method(D_METHOD("_remove_action_set", "name"), &OpenXRActionMapEditor::_remove_action_set);
ClassDB::bind_method(D_METHOD("_do_add_action_set_editor", "action_set_editor"), &OpenXRActionMapEditor::_do_add_action_set_editor);
@ -175,7 +174,7 @@ void OpenXRActionMapEditor::_on_add_action_set() {
// Make sure our action set is the current tab
tabs->set_current_tab(0);
call_deferred("_set_focus_on_action_set", new_action_set_editor);
callable_mp(this, &OpenXRActionMapEditor::_set_focus_on_action_set).call_deferred(new_action_set_editor);
}
void OpenXRActionMapEditor::_set_focus_on_action_set(OpenXRActionSetEditor *p_action_set_editor) {

View File

@ -484,7 +484,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv *
env->DeleteLocalRef(jobj);
}
MessageQueue::get_singleton()->push_callp(obj, str_method, argptrs, count);
Callable(obj, str_method).call_deferredp(argptrs, count);
}
JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) {

View File

@ -3875,7 +3875,7 @@ void DisplayServerX11::_xim_preedit_draw_callback(::XIM xim, ::XPointer client_d
ds->im_selection = Point2i();
}
OS_Unix::get_singleton()->get_main_loop()->call_deferred(SNAME("notification"), MainLoop::NOTIFICATION_OS_IME_UPDATE);
callable_mp((Object *)OS_Unix::get_singleton()->get_main_loop(), &Object::notification).call_deferred(MainLoop::NOTIFICATION_OS_IME_UPDATE, false);
}
}

View File

@ -245,7 +245,7 @@ void NavigationRegion2D::bake_navigation_polygon(bool p_on_thread) {
void NavigationRegion2D::_bake_finished(Ref<NavigationPolygon> p_navigation_polygon) {
if (!Thread::is_main_thread()) {
call_deferred(SNAME("_bake_finished"), p_navigation_polygon);
callable_mp(this, &NavigationRegion2D::_bake_finished).call_deferred(p_navigation_polygon);
return;
}

View File

@ -555,7 +555,7 @@ void Skeleton2D::_make_bone_setup_dirty() {
}
bone_setup_dirty = true;
if (is_inside_tree()) {
call_deferred(SNAME("_update_bone_setup"));
callable_mp(this, &Skeleton2D::_update_bone_setup).call_deferred();
}
}
@ -593,7 +593,7 @@ void Skeleton2D::_make_transform_dirty() {
}
transform_dirty = true;
if (is_inside_tree()) {
call_deferred(SNAME("_update_transform"));
callable_mp(this, &Skeleton2D::_update_transform).call_deferred();
}
}
@ -764,9 +764,6 @@ void Skeleton2D::execute_modifications(real_t p_delta, int p_execution_mode) {
}
void Skeleton2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_bone_setup"), &Skeleton2D::_update_bone_setup);
ClassDB::bind_method(D_METHOD("_update_transform"), &Skeleton2D::_update_transform);
ClassDB::bind_method(D_METHOD("get_bone_count"), &Skeleton2D::get_bone_count);
ClassDB::bind_method(D_METHOD("get_bone", "idx"), &Skeleton2D::get_bone);

View File

@ -150,7 +150,7 @@ void BoneAttachment3D::_check_bind() {
if (bone_idx != -1) {
sk->connect(SNAME("bone_pose_changed"), callable_mp(this, &BoneAttachment3D::on_bone_pose_update));
bound = true;
call_deferred(SNAME("on_bone_pose_update"), bone_idx);
callable_mp(this, &BoneAttachment3D::on_bone_pose_update).call_deferred(bone_idx);
}
}
}

View File

@ -258,7 +258,7 @@ void NavigationRegion3D::bake_navigation_mesh(bool p_on_thread) {
void NavigationRegion3D::_bake_finished(Ref<NavigationMesh> p_navigation_mesh) {
if (!Thread::is_main_thread()) {
call_deferred(SNAME("_bake_finished"), p_navigation_mesh);
callable_mp(this, &NavigationRegion3D::_bake_finished).call_deferred(p_navigation_mesh);
return;
}
@ -308,7 +308,6 @@ void NavigationRegion3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_travel_cost"), &NavigationRegion3D::get_travel_cost);
ClassDB::bind_method(D_METHOD("bake_navigation_mesh", "on_thread"), &NavigationRegion3D::bake_navigation_mesh, DEFVAL(true));
ClassDB::bind_method(D_METHOD("_bake_finished", "navigation_mesh"), &NavigationRegion3D::_bake_finished);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "navigation_mesh", PROPERTY_HINT_RESOURCE_TYPE, "NavigationMesh"), "set_navigation_mesh", "get_navigation_mesh");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enabled"), "set_enabled", "is_enabled");

View File

@ -30,7 +30,6 @@
#include "node_3d.h"
#include "core/object/message_queue.h"
#include "scene/3d/visual_instance_3d.h"
#include "scene/main/viewport.h"
#include "scene/property_utils.h"
@ -124,7 +123,7 @@ void Node3D::_propagate_transform_changed(Node3D *p_origin) {
get_tree()->xform_change_list.add(&xform_change);
} else {
// This should very rarely happen, but if it does at least make sure the notification is received eventually.
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Node3D::_propagate_transform_changed_deferred));
callable_mp(this, &Node3D::_propagate_transform_changed_deferred).call_deferred();
}
}
_set_dirty_bits(DIRTY_GLOBAL_TRANSFORM);
@ -568,7 +567,7 @@ void Node3D::update_gizmos() {
return;
}
data.gizmos_dirty = true;
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Node3D::_update_gizmos));
callable_mp(this, &Node3D::_update_gizmos).call_deferred();
#endif
}

View File

@ -30,7 +30,6 @@
#include "skeleton_3d.h"
#include "core/object/message_queue.h"
#include "core/variant/type_info.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/resources/surface_tool.h"

View File

@ -416,8 +416,8 @@ void SoftBody3D::_draw_soft_mesh() {
/// Necessary in order to render the mesh correctly (Soft body nodes are in global space)
simulation_started = true;
call_deferred(SNAME("set_as_top_level"), true);
call_deferred(SNAME("set_transform"), Transform3D());
callable_mp((Node3D *)this, &Node3D::set_as_top_level).call_deferred(true);
callable_mp((Node3D *)this, &Node3D::set_transform).call_deferred(Transform3D());
}
_update_physics_server();

View File

@ -332,7 +332,7 @@ void AnimationNodeBlendSpace2D::_queue_auto_triangles() {
}
trianges_dirty = true;
call_deferred(SNAME("_update_triangles"));
callable_mp(this, &AnimationNodeBlendSpace2D::_update_triangles).call_deferred();
}
void AnimationNodeBlendSpace2D::_update_triangles() {
@ -689,8 +689,6 @@ void AnimationNodeBlendSpace2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_use_sync", "enable"), &AnimationNodeBlendSpace2D::set_use_sync);
ClassDB::bind_method(D_METHOD("is_using_sync"), &AnimationNodeBlendSpace2D::is_using_sync);
ClassDB::bind_method(D_METHOD("_update_triangles"), &AnimationNodeBlendSpace2D::_update_triangles);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_auto_triangles", "get_auto_triangles");
for (int i = 0; i < MAX_BLEND_POINTS; i++) {

View File

@ -1778,7 +1778,7 @@ void AnimationMixer::_call_object(ObjectID p_object_id, const StringName &p_meth
return;
}
if (p_deferred) {
MessageQueue::get_singleton()->push_callp(t_obj, p_method, argptrs, argcount);
Callable(t_obj, p_method).call_deferredp(argptrs, argcount);
} else {
Callable::CallError ce;
t_obj->callp(p_method, argptrs, argcount, ce);

View File

@ -619,7 +619,7 @@ void AnimationTree::_tree_changed() {
return;
}
call_deferred(SNAME("_update_properties"));
callable_mp(this, &AnimationTree::_update_properties).call_deferred();
properties_dirty = true;
}
@ -886,8 +886,6 @@ void AnimationTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_animation_player", "path"), &AnimationTree::set_animation_player);
ClassDB::bind_method(D_METHOD("get_animation_player"), &AnimationTree::get_animation_player);
ClassDB::bind_method(D_METHOD("_update_properties"), &AnimationTree::_update_properties);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "tree_root", PROPERTY_HINT_RESOURCE_TYPE, "AnimationRootNode"), "set_tree_root", "get_tree_root");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "advance_expression_base_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Node"), "set_advance_expression_base_node", "get_advance_expression_base_node");
ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "anim_player", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "AnimationPlayer"), "set_animation_player", "get_animation_player");

View File

@ -219,7 +219,7 @@ void ColorPicker::finish_shaders() {
}
void ColorPicker::set_focus_on_line_edit() {
c_text->call_deferred(SNAME("grab_focus"));
callable_mp((Control *)c_text, &Control::grab_focus).call_deferred();
}
void ColorPicker::_update_controls() {

View File

@ -30,7 +30,6 @@
#include "container.h"
#include "core/object/message_queue.h"
#include "scene/scene_string_names.h"
void Container::_child_minsize_changed() {
@ -138,7 +137,7 @@ void Container::queue_sort() {
return;
}
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Container::_sort_children));
callable_mp(this, &Container::_sort_children).call_deferred();
pending_sort = true;
}

View File

@ -33,7 +33,6 @@
#include "container.h"
#include "core/config/project_settings.h"
#include "core/math/geometry_2d.h"
#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
@ -1631,7 +1630,7 @@ void Control::update_minimum_size() {
}
data.updating_last_minimum_size = true;
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Control::_update_minimum_size));
callable_mp(this, &Control::_update_minimum_size).call_deferred();
}
void Control::set_block_minimum_size_adjust(bool p_block) {

View File

@ -129,7 +129,7 @@ void AcceptDialog::_cancel_pressed() {
parent_visible = nullptr;
}
call_deferred(SNAME("hide"));
callable_mp((Window *)this, &Window::hide).call_deferred();
emit_signal(SNAME("canceled"));

View File

@ -31,7 +31,6 @@
#include "line_edit.h"
#include "core/input/input_map.h"
#include "core/object/message_queue.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
@ -270,7 +269,7 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
if (!text_changed_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed");
callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@ -714,7 +713,7 @@ void LineEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
select(caret_column_tmp, caret_column);
if (!text_changed_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed");
callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@ -1190,7 +1189,7 @@ void LineEdit::paste_text() {
if (!text_changed_dirty) {
if (is_inside_tree() && text.length() != prev_len) {
MessageQueue::get_singleton()->push_call(this, "_text_changed");
callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@ -1504,7 +1503,7 @@ void LineEdit::delete_text(int p_from_column, int p_to_column) {
if (!text_changed_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed");
callable_mp(this, &LineEdit::_text_changed).call_deferred();
}
text_changed_dirty = true;
}
@ -2512,8 +2511,6 @@ void LineEdit::_validate_property(PropertyInfo &p_property) const {
}
void LineEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("_text_changed"), &LineEdit::_text_changed);
ClassDB::bind_method(D_METHOD("set_horizontal_alignment", "alignment"), &LineEdit::set_horizontal_alignment);
ClassDB::bind_method(D_METHOD("get_horizontal_alignment"), &LineEdit::get_horizontal_alignment);

View File

@ -123,7 +123,7 @@ void Popup::_close_pressed() {
_deinitialize_visible_parents();
call_deferred(SNAME("hide"));
callable_mp((Window *)this, &Window::hide).call_deferred();
}
void Popup::_post_popup() {

View File

@ -2805,7 +2805,7 @@ void RichTextLabel::_thread_function(void *p_userdata) {
set_current_thread_safe_for_nodes(true);
_process_line_caches();
updating.store(false);
call_deferred(SNAME("thread_end"));
callable_mp(this, &RichTextLabel::_thread_end).call_deferred();
}
void RichTextLabel::_thread_end() {
@ -5945,8 +5945,6 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_menu_visible"), &RichTextLabel::is_menu_visible);
ClassDB::bind_method(D_METHOD("menu_option", "option"), &RichTextLabel::menu_option);
ClassDB::bind_method(D_METHOD("_thread_end"), &RichTextLabel::_thread_end);
#ifndef DISABLE_DEPRECATED
ClassDB::bind_compatibility_method(D_METHOD("push_font", "font", "font_size"), &RichTextLabel::push_font);
ClassDB::bind_compatibility_method(D_METHOD("set_table_column_expand", "column", "expand", "ratio"), &RichTextLabel::set_table_column_expand);

View File

@ -346,7 +346,7 @@ void ScrollContainer::_notification(int p_what) {
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED: {
_updating_scrollbars = true;
call_deferred(SNAME("_update_scrollbar_position"));
callable_mp(this, &ScrollContainer::_update_scrollbar_position).call_deferred();
} break;
case NOTIFICATION_READY: {
@ -573,8 +573,6 @@ VScrollBar *ScrollContainer::get_v_scroll_bar() {
}
void ScrollContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_scrollbar_position"), &ScrollContainer::_update_scrollbar_position);
ClassDB::bind_method(D_METHOD("set_h_scroll", "value"), &ScrollContainer::set_h_scroll);
ClassDB::bind_method(D_METHOD("get_h_scroll"), &ScrollContainer::get_h_scroll);

View File

@ -280,8 +280,8 @@ void SpinBox::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
call_deferred(SNAME("update_minimum_size"));
get_line_edit()->call_deferred(SNAME("update_minimum_size"));
callable_mp((Control *)this, &Control::update_minimum_size).call_deferred();
callable_mp((Control *)get_line_edit(), &Control::update_minimum_size).call_deferred();
} break;
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {

View File

@ -30,7 +30,6 @@
#include "tab_bar.h"
#include "core/object/message_queue.h"
#include "core/string/translation.h"
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"

View File

@ -33,7 +33,6 @@
#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/input/input_map.h"
#include "core/object/message_queue.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
@ -428,10 +427,10 @@ void TextEdit::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
_update_caches();
if (caret_pos_dirty) {
MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
callable_mp(this, &TextEdit::_emit_caret_changed).call_deferred();
}
if (text_changed_dirty) {
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
callable_mp(this, &TextEdit::_text_changed_emit).call_deferred();
}
_update_wrap_at_column(true);
} break;
@ -443,8 +442,8 @@ void TextEdit::_notification(int p_what) {
case NOTIFICATION_VISIBILITY_CHANGED: {
if (is_visible()) {
call_deferred(SNAME("_update_scrollbars"));
call_deferred(SNAME("_update_wrap_at_column"));
callable_mp(this, &TextEdit::_update_scrollbars).call_deferred();
callable_mp(this, &TextEdit::_update_wrap_at_column).call_deferred(false);
}
} break;
@ -4008,7 +4007,7 @@ void TextEdit::undo() {
if (dirty_carets && !caret_pos_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
callable_mp(this, &TextEdit::_emit_caret_changed).call_deferred();
}
caret_pos_dirty = true;
}
@ -4063,7 +4062,7 @@ void TextEdit::redo() {
if (dirty_carets && !caret_pos_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
callable_mp(this, &TextEdit::_emit_caret_changed).call_deferred();
}
caret_pos_dirty = true;
}
@ -4869,7 +4868,7 @@ void TextEdit::set_caret_line(int p_line, bool p_adjust_viewport, bool p_can_be_
if (caret_moved && !caret_pos_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
callable_mp(this, &TextEdit::_emit_caret_changed).call_deferred();
}
caret_pos_dirty = true;
}
@ -4900,7 +4899,7 @@ void TextEdit::set_caret_column(int p_col, bool p_adjust_viewport, int p_caret)
if (caret_moved && !caret_pos_dirty) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_emit_caret_changed");
callable_mp(this, &TextEdit::_emit_caret_changed).call_deferred();
}
caret_pos_dirty = true;
}
@ -6027,10 +6026,6 @@ Color TextEdit::get_font_color() const {
}
void TextEdit::_bind_methods() {
/* Internal. */
ClassDB::bind_method(D_METHOD("_text_changed_emit"), &TextEdit::_text_changed_emit);
/* Text */
// Text properties
ClassDB::bind_method(D_METHOD("has_ime_text"), &TextEdit::has_ime_text);
@ -6201,9 +6196,6 @@ void TextEdit::_bind_methods() {
BIND_ENUM_CONSTANT(CARET_TYPE_LINE);
BIND_ENUM_CONSTANT(CARET_TYPE_BLOCK);
// Internal.
ClassDB::bind_method(D_METHOD("_emit_caret_changed"), &TextEdit::_emit_caret_changed);
ClassDB::bind_method(D_METHOD("set_caret_type", "type"), &TextEdit::set_caret_type);
ClassDB::bind_method(D_METHOD("get_caret_type"), &TextEdit::get_caret_type);
@ -6291,9 +6283,6 @@ void TextEdit::_bind_methods() {
BIND_ENUM_CONSTANT(LINE_WRAPPING_NONE);
BIND_ENUM_CONSTANT(LINE_WRAPPING_BOUNDARY);
// Internal.
ClassDB::bind_method(D_METHOD("_update_wrap_at_column", "force"), &TextEdit::_update_wrap_at_column, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_line_wrapping_mode", "mode"), &TextEdit::set_line_wrapping_mode);
ClassDB::bind_method(D_METHOD("get_line_wrapping_mode"), &TextEdit::get_line_wrapping_mode);
@ -7827,7 +7816,7 @@ void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, i
if (!text_changed_dirty && !setting_text) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
callable_mp(this, &TextEdit::_text_changed_emit).call_deferred();
}
text_changed_dirty = true;
}
@ -7873,7 +7862,7 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column, int p_to_li
if (!text_changed_dirty && !setting_text) {
if (is_inside_tree()) {
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
callable_mp(this, &TextEdit::_text_changed_emit).call_deferred();
}
text_changed_dirty = true;
}

View File

@ -4784,7 +4784,7 @@ void Tree::ensure_cursor_is_visible() {
if (cell_h > screen_h) { // Screen size is too small, maybe it was not resized yet.
v_scroll->set_value(y_offset);
} else if (y_offset + cell_h > v_scroll->get_value() + screen_h) {
v_scroll->call_deferred(SNAME("set_value"), y_offset - screen_h + cell_h);
callable_mp((Range *)v_scroll, &Range::set_value).call_deferred(y_offset - screen_h + cell_h);
} else if (y_offset < v_scroll->get_value()) {
v_scroll->set_value(y_offset);
}
@ -4802,7 +4802,7 @@ void Tree::ensure_cursor_is_visible() {
if (cell_w > screen_w) {
h_scroll->set_value(x_offset);
} else if (x_offset + cell_w > h_scroll->get_value() + screen_w) {
h_scroll->call_deferred(SNAME("set_value"), x_offset - screen_w + cell_w);
callable_mp((Range *)h_scroll, &Range::set_value).call_deferred(x_offset - screen_w + cell_w);
} else if (x_offset < h_scroll->get_value()) {
h_scroll->set_value(x_offset);
}

View File

@ -30,7 +30,6 @@
#include "canvas_item.h"
#include "core/object/message_queue.h"
#include "scene/2d/canvas_group.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
@ -407,7 +406,7 @@ void CanvasItem::queue_redraw() {
pending_update = true;
MessageQueue::get_singleton()->push_callable(callable_mp(this, &CanvasItem::_redraw_callback));
callable_mp(this, &CanvasItem::_redraw_callback).call_deferred();
}
void CanvasItem::move_to_front() {
@ -904,7 +903,7 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) {
get_tree()->xform_change_list.add(&p_node->xform_change);
} else {
// Should be rare, but still needs to be handled.
MessageQueue::get_singleton()->push_callable(callable_mp(p_node, &CanvasItem::_notify_transform_deferred));
callable_mp(p_node, &CanvasItem::_notify_transform_deferred).call_deferred();
}
}
}

View File

@ -472,7 +472,7 @@ bool HTTPRequest::_update_connection() {
}
void HTTPRequest::_defer_done(int p_status, int p_code, const PackedStringArray &p_headers, const PackedByteArray &p_data) {
call_deferred(SNAME("_request_done"), p_status, p_code, p_headers, p_data);
callable_mp(this, &HTTPRequest::_request_done).call_deferred(p_status, p_code, p_headers, p_data);
}
void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArray &p_headers, const PackedByteArray &p_data) {
@ -621,8 +621,6 @@ void HTTPRequest::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_downloaded_bytes"), &HTTPRequest::get_downloaded_bytes);
ClassDB::bind_method(D_METHOD("get_body_size"), &HTTPRequest::get_body_size);
ClassDB::bind_method(D_METHOD("_request_done"), &HTTPRequest::_request_done);
ClassDB::bind_method(D_METHOD("set_timeout", "timeout"), &HTTPRequest::set_timeout);
ClassDB::bind_method(D_METHOD("get_timeout"), &HTTPRequest::get_timeout);

View File

@ -32,7 +32,6 @@
#include "core/config/project_settings.h"
#include "core/debugger/engine_debugger.h"
#include "core/object/message_queue.h"
#include "core/string/translation.h"
#include "core/templates/pair.h"
#include "core/templates/sort_array.h"
@ -1054,7 +1053,7 @@ void Viewport::canvas_parent_mark_dirty(Node *p_node) {
bool request_update = gui.canvas_parents_with_dirty_order.is_empty();
gui.canvas_parents_with_dirty_order.insert(p_node->get_instance_id());
if (request_update) {
MessageQueue::get_singleton()->push_callable(callable_mp(this, &Viewport::_process_dirty_canvas_parent_orders));
callable_mp(this, &Viewport::_process_dirty_canvas_parent_orders).call_deferred();
}
}
@ -2700,7 +2699,7 @@ void Viewport::_cleanup_mouseover_colliders(bool p_clean_all_frames, bool p_paus
void Viewport::_gui_grab_click_focus(Control *p_control) {
gui.mouse_click_grabber = p_control;
call_deferred(SNAME("_post_gui_grab_click_focus"));
callable_mp(this, &Viewport::_post_gui_grab_click_focus).call_deferred();
}
void Viewport::_post_gui_grab_click_focus() {
@ -2748,7 +2747,7 @@ void Viewport::_post_gui_grab_click_focus() {
mb->set_button_index(MouseButton(i + 1));
mb->set_pressed(true);
mb->set_device(InputEvent::DEVICE_ID_INTERNAL);
MessageQueue::get_singleton()->push_callable(callable_mp(gui.mouse_focus, &Control::_call_gui_input), mb);
callable_mp(gui.mouse_focus, &Control::_call_gui_input).call_deferred(mb);
}
}
}
@ -4627,7 +4626,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled);
ClassDB::bind_method(D_METHOD("_gui_remove_focus_for_window"), &Viewport::_gui_remove_focus_for_window);
ClassDB::bind_method(D_METHOD("_post_gui_grab_click_focus"), &Viewport::_post_gui_grab_click_focus);
ClassDB::bind_method(D_METHOD("set_positional_shadow_atlas_size", "size"), &Viewport::set_positional_shadow_atlas_size);
ClassDB::bind_method(D_METHOD("get_positional_shadow_atlas_size"), &Viewport::get_positional_shadow_atlas_size);

View File

@ -1516,7 +1516,7 @@ void Window::child_controls_changed() {
}
updating_child_controls = true;
call_deferred(SNAME("_update_child_controls"));
callable_mp(this, &Window::_update_child_controls).call_deferred();
}
void Window::_update_child_controls() {
@ -1997,7 +1997,7 @@ void Window::_update_theme_item_cache() {
// Updating without a delay can cause a lot of lag.
if (!wrap_controls) {
updating_embedded_window = true;
call_deferred(SNAME("_update_embedded_window"));
callable_mp(this, &Window::_update_embedded_window).call_deferred();
} else {
child_controls_changed();
}
@ -2800,9 +2800,6 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_wrapping_controls"), &Window::is_wrapping_controls);
ClassDB::bind_method(D_METHOD("child_controls_changed"), &Window::child_controls_changed);
ClassDB::bind_method(D_METHOD("_update_child_controls"), &Window::_update_child_controls);
ClassDB::bind_method(D_METHOD("_update_embedded_window"), &Window::_update_embedded_window);
ClassDB::bind_method(D_METHOD("set_theme", "theme"), &Window::set_theme);
ClassDB::bind_method(D_METHOD("get_theme"), &Window::get_theme);

View File

@ -41,8 +41,6 @@ void CurveTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_texture_mode", "texture_mode"), &CurveTexture::set_texture_mode);
ClassDB::bind_method(D_METHOD("get_texture_mode"), &CurveTexture::get_texture_mode);
ClassDB::bind_method(D_METHOD("_update"), &CurveTexture::_update);
ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,4096,suffix:px"), "set_width", "get_width");
ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_mode", PROPERTY_HINT_ENUM, "RGB,Red"), "set_texture_mode", "get_texture_mode");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve");
@ -190,8 +188,6 @@ void CurveXYZTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_curve_z", "curve"), &CurveXYZTexture::set_curve_z);
ClassDB::bind_method(D_METHOD("get_curve_z"), &CurveXYZTexture::get_curve_z);
ClassDB::bind_method(D_METHOD("_update"), &CurveXYZTexture::_update);
ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "1,4096,suffix:px"), "set_width", "get_width");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve_x", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve_x", "get_curve_x");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve_y", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve_y", "get_curve_y");

View File

@ -232,8 +232,6 @@ RID PrimitiveMesh::get_rid() const {
}
void PrimitiveMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update"), &PrimitiveMesh::_update);
ClassDB::bind_method(D_METHOD("set_material", "material"), &PrimitiveMesh::set_material);
ClassDB::bind_method(D_METHOD("get_material"), &PrimitiveMesh::get_material);
@ -3342,7 +3340,6 @@ void TextMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_uppercase", "enable"), &TextMesh::set_uppercase);
ClassDB::bind_method(D_METHOD("is_uppercase"), &TextMesh::is_uppercase);
ClassDB::bind_method(D_METHOD("_font_changed"), &TextMesh::_font_changed);
ClassDB::bind_method(D_METHOD("_request_update"), &TextMesh::_request_update);
ADD_GROUP("Text", "");
@ -3446,14 +3443,16 @@ void TextMesh::_font_changed() {
void TextMesh::set_font(const Ref<Font> &p_font) {
if (font_override != p_font) {
const Callable font_changed = callable_mp(this, &TextMesh::_font_changed);
if (font_override.is_valid()) {
font_override->disconnect_changed(Callable(this, "_font_changed"));
font_override->disconnect_changed(font_changed);
}
font_override = p_font;
dirty_font = true;
dirty_cache = true;
if (font_override.is_valid()) {
font_override->connect_changed(Callable(this, "_font_changed"));
font_override->connect_changed(font_changed);
}
_request_update();
}

View File

@ -4675,7 +4675,6 @@ void TileSetAtlasSource::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_tile_texture_region", "atlas_coords", "frame"), &TileSetAtlasSource::get_tile_texture_region, DEFVAL(0));
// Getters for texture and tile region (padded or not)
ClassDB::bind_method(D_METHOD("_update_padded_texture"), &TileSetAtlasSource::_update_padded_texture);
ClassDB::bind_method(D_METHOD("get_runtime_texture"), &TileSetAtlasSource::get_runtime_texture);
ClassDB::bind_method(D_METHOD("get_runtime_tile_texture_region", "atlas_coords", "frame"), &TileSetAtlasSource::get_runtime_tile_texture_region);
@ -4761,7 +4760,7 @@ void TileSetAtlasSource::_create_coords_mapping_cache(Vector2i p_atlas_coords) {
void TileSetAtlasSource::_queue_update_padded_texture() {
padded_texture_needs_update = true;
call_deferred(SNAME("_update_padded_texture"));
callable_mp(this, &TileSetAtlasSource::_update_padded_texture).call_deferred();
}
Ref<ImageTexture> TileSetAtlasSource::_create_padded_image_texture(const Ref<Texture2D> &p_source) {

View File

@ -286,7 +286,7 @@ void NavigationServer3D::set_debug_enabled(bool p_enabled) {
debug_enabled = p_enabled;
if (debug_dirty) {
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
#endif // DEBUG_ENABLED
}
@ -693,7 +693,7 @@ Color NavigationServer3D::get_debug_navigation_agent_path_color() const {
void NavigationServer3D::set_debug_navigation_enable_edge_connections(const bool p_value) {
debug_navigation_enable_edge_connections = p_value;
navigation_debug_dirty = true;
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_enable_edge_connections() const {
@ -714,7 +714,7 @@ bool NavigationServer3D::get_debug_navigation_enable_edge_connections_xray() con
void NavigationServer3D::set_debug_navigation_enable_edge_lines(const bool p_value) {
debug_navigation_enable_edge_lines = p_value;
navigation_debug_dirty = true;
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_enable_edge_lines() const {
@ -735,7 +735,7 @@ bool NavigationServer3D::get_debug_navigation_enable_edge_lines_xray() const {
void NavigationServer3D::set_debug_navigation_enable_geometry_face_random_color(const bool p_value) {
debug_navigation_enable_geometry_face_random_color = p_value;
navigation_debug_dirty = true;
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_enable_geometry_face_random_color() const {
@ -745,7 +745,7 @@ bool NavigationServer3D::get_debug_navigation_enable_geometry_face_random_color(
void NavigationServer3D::set_debug_navigation_enable_link_connections(const bool p_value) {
debug_navigation_enable_link_connections = p_value;
navigation_debug_dirty = true;
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_enable_link_connections() const {
@ -766,7 +766,7 @@ bool NavigationServer3D::get_debug_navigation_enable_link_connections_xray() con
void NavigationServer3D::set_debug_navigation_avoidance_enable_agents_radius(const bool p_value) {
debug_navigation_avoidance_enable_agents_radius = p_value;
avoidance_debug_dirty = true;
call_deferred("_emit_avoidance_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_avoidance_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_avoidance_enable_agents_radius() const {
@ -776,7 +776,7 @@ bool NavigationServer3D::get_debug_navigation_avoidance_enable_agents_radius() c
void NavigationServer3D::set_debug_navigation_avoidance_enable_obstacles_radius(const bool p_value) {
debug_navigation_avoidance_enable_obstacles_radius = p_value;
avoidance_debug_dirty = true;
call_deferred("_emit_avoidance_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_avoidance_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_avoidance_enable_obstacles_radius() const {
@ -786,7 +786,7 @@ bool NavigationServer3D::get_debug_navigation_avoidance_enable_obstacles_radius(
void NavigationServer3D::set_debug_navigation_avoidance_enable_obstacles_static(const bool p_value) {
debug_navigation_avoidance_enable_obstacles_static = p_value;
avoidance_debug_dirty = true;
call_deferred("_emit_avoidance_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_avoidance_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_avoidance_enable_obstacles_static() const {
@ -867,7 +867,7 @@ void NavigationServer3D::set_debug_navigation_enable_agent_paths(const bool p_va
debug_navigation_enable_agent_paths = p_value;
if (debug_dirty) {
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
}
@ -892,7 +892,7 @@ bool NavigationServer3D::get_debug_navigation_enable_agent_paths_xray() const {
void NavigationServer3D::set_debug_navigation_enabled(bool p_enabled) {
debug_navigation_enabled = p_enabled;
navigation_debug_dirty = true;
call_deferred("_emit_navigation_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_navigation_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_navigation_enabled() const {
@ -902,7 +902,7 @@ bool NavigationServer3D::get_debug_navigation_enabled() const {
void NavigationServer3D::set_debug_avoidance_enabled(bool p_enabled) {
debug_avoidance_enabled = p_enabled;
avoidance_debug_dirty = true;
call_deferred("_emit_avoidance_debug_changed_signal");
callable_mp(this, &NavigationServer3D::_emit_avoidance_debug_changed_signal).call_deferred();
}
bool NavigationServer3D::get_debug_avoidance_enabled() const {