MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / update

Method update

gui/gdre_progress.cpp:222–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222bool GDREProgressDialog::Task::update() {
223 ERR_FAIL_COND_V(!initialized, false);
224 if (!vb) {
225 return false;
226 }
227 // 1 frame at 60fps
228 constexpr uint64_t REDRAW_THRESHOLD = 1000000 / 60;
229 auto curr_time_us = OS::get_singleton()->get_ticks_usec();
230 if (!should_redraw(curr_time_us)) {
231 if (!is_headless && !(curr_time_us - last_progress_tick >= REDRAW_THRESHOLD && (progress->get_value() != current_step.step || state->get_text() != current_step.state || indeterminate != progress->is_indeterminate() || steps != progress->get_max()))) {
232 return false;
233 }
234 }
235 force_next_redraw = false;
236
237 if (!is_headless) {
238 if (indeterminate != progress->is_indeterminate()) {
239 progress->set_indeterminate(indeterminate);
240 }
241 if (steps != progress->get_max()) {
242 progress->set_max(steps);
243 }
244 if (!indeterminate) {
245 if (progress->get_value() != current_step.step) {
246 progress->set_value(current_step.step);
247 }
248 }
249 if (state->get_text() != current_step.state) {
250 state->set_text(current_step.state);
251 }
252 }
253 last_progress_tick = OS::get_singleton()->get_ticks_usec();
254 return true;
255}
256
257void GDREProgressDialog::_popup() {
258 // if (GodotREEditorStandalone::get_singleton()) {

Callers 2

get_sha256_for_dirFunction · 0.45
main_thread_updateMethod · 0.45

Calls 4

get_maxMethod · 0.80
set_indeterminateMethod · 0.80
get_valueMethod · 0.45
set_valueMethod · 0.45

Tested by

no test coverage detected