Merge pull request #781 from vangel76/script-773-repeating-tasks

#773: run repeating app.scheduleTask tasks until cancelTask
This commit is contained in:
Brandon Thomas
2026-10-12 03:03:45 -04:00
13 changed files with 668 additions and 57 deletions
+7 -1
View File
@@ -14,7 +14,8 @@
//! ```
//!
//! * **Object model** (`prelude.js`): `app` (project, open/newProject, undo groups,
//! `executeCommand`/`findMenuCommandId`, `scheduleTask`, `settings` kept in the settings
//! `executeCommand`/`findMenuCommandId`, `scheduleTask` (one-shot and repeating, see
//! [`run_tasks`]), `settings` kept in the settings
//! folder), `Project`, `ItemCollection`,
//! `CompItem`/`FootageItem`/`FolderItem`, `LayerCollection`, `AVLayer`/`TextLayer`/
//! `ShapeLayer`/`CameraLayer`/`LightLayer`, `PropertyGroup`/`Property` (values, keyframes,
@@ -59,11 +60,13 @@ mod model;
mod runtime;
mod scriptfile;
mod socket;
mod tasks;
mod ui;
use effectcraft_engine::{ScriptRequest, Session};
pub use runtime::{Outcome, ScriptError, run};
pub use tasks::{MAX_TASKS, MIN_REPEAT_MS, run_tasks};
pub use ui::dispatch_ui;
/// The [`effectcraft_engine::ScriptRunner`] this crate provides.
@@ -75,6 +78,7 @@ pub fn runner(s: &mut Session, req: &ScriptRequest) -> serde_json::Value {
pub fn install(s: &mut Session) {
s.script = Some(runner);
s.script_ui.dispatch = Some(dispatch_ui);
s.script_ui.tasks = Some(run_tasks);
}
/// Run `code` as a one-off script named `name`.
@@ -93,6 +97,8 @@ mod tests_include;
#[cfg(test)]
mod tests_panels;
#[cfg(test)]
mod tests_tasks;
#[cfg(test)]
mod tests_ui;
#[cfg(test)]
mod tests_ui_more;