nightshade 0.56.0

A cross-platform data-oriented game engine.
Documentation
//! The cutscene composition. The cutscene subsystem itself lives in
//! [`crate::ecs::cutscene`] because it is core; this plugin is what makes
//! playback advance on its own.

use crate::app::{App, Plugin, Stage, push_frame_system};
use crate::ecs::world::World;

/// Registers the cutscene advance into the frame update stage, a no-op on
/// every frame without an active or just-stopped cutscene.
pub fn register_frame_systems(stages: &mut freecs::Stages<World>) {
    push_frame_system(
        stages,
        Stage::FrameUpdate,
        crate::ecs::cutscene::advance_cutscene_system,
    );
}

/// Advances cutscenes automatically: composing this makes `play_cutscene`
/// and the reel and queue APIs run without the game calling
/// [`advance_cutscene_system`](crate::ecs::cutscene::advance_cutscene_system)
/// itself. Hosts that scrub or step cutscenes manually, like the editor's
/// preview, skip the plugin and keep the manual call.
pub struct CutscenePlugin;

impl Plugin for CutscenePlugin {
    fn build(&self, app: &mut App) {
        register_frame_systems(&mut app.stages);
    }
}