You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Update deferred calls to use Callables
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user