Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,29 @@ class EditorNode : public Node {

struct EditorProgress {
String task;
bool step(const String &p_state, int p_step = -1, bool p_force_refresh = true) { return EditorNode::progress_task_step(task, p_state, p_step, p_force_refresh); }
bool step(const String &p_state, int p_step = -1, bool p_force_refresh = true) {
if (Thread::is_main_thread()) {
return EditorNode::progress_task_step(task, p_state, p_step, p_force_refresh);
} else {
EditorNode::progress_task_step_bg(task, p_step);
return false;
}
}
EditorProgress(const String &p_task, const String &p_label, int p_amount, bool p_can_cancel = false) {
EditorNode::progress_add_task(p_task, p_label, p_amount, p_can_cancel);
if (Thread::is_main_thread()) {
EditorNode::progress_add_task(p_task, p_label, p_amount, p_can_cancel);
} else {
EditorNode::progress_add_task_bg(p_task, p_label, p_amount);
}
task = p_task;
}
~EditorProgress() { EditorNode::progress_end_task(task); }
~EditorProgress() {
if (Thread::is_main_thread()) {
EditorNode::progress_end_task(task);
} else {
EditorNode::progress_end_task_bg(task);
}
}
};

class EditorPluginList : public Object {
Expand Down