codecraft 0.1.1

A minimalist 3D game engine built on parts of Bevy (ECS, color) with wgpu and winit: OpenPBR materials, clustered lighting, an immediate-mode UI, audio and gamepad haptics
Documentation
use bevy_ecs::schedule::IntoScheduleConfigs;

use crate::ecs::{Application, Plugin};

use super::resources::{CursorPosition, MouseInput, ScreenSize, UiDrawList};
use super::systems::{
    advance_progress_system, clear_input_edge_system, collect_quads_system, dispatch_clicks_system,
    dispatch_panel_close_system, dispatch_progress_full_system, drag_panel_system,
    relayout_menu_system, update_interaction_system, update_pointer_capture_system,
};
use super::submenu::update_submenu_system;
use crate::time::Time;

/// Registers the UI resources and the per-frame interaction/draw-list systems.
pub struct UiPlugin;

impl Plugin for UiPlugin {
    fn build(&self, app: &mut Application) {
        app.insert_resource(CursorPosition::default());
        app.insert_resource(MouseInput::default());
        app.insert_resource(ScreenSize::default());
        app.init_resource::<super::resources::PointerCapture>();
        app.insert_resource(UiDrawList::default());
        app.insert_resource(super::atlas::Atlas::new());
        app.init_resource::<super::font::Font>();
        app.init_resource::<super::outliner::Outliner>();
        // The host app republishes this every frame; the default keeps the UI
        // schedule runnable on its own (tests, headless use).
        app.insert_resource(Time::default());

        app.add_update_systems(
            (
                update_pointer_capture_system,
                super::outliner::scroll_outliner_system,
                super::outliner::rebuild_outliner_system,
                relayout_menu_system,
                // After the relayout that may have moved a parent, and before
                // the interaction pass that decides what the pointer is over:
                // a submenu that opened this frame is hoverable this frame.
                update_submenu_system,
                advance_progress_system,
                dispatch_progress_full_system,
                update_interaction_system,
                dispatch_clicks_system,
                dispatch_panel_close_system,
                drag_panel_system,
                collect_quads_system,
                clear_input_edge_system,
            )
                .chain(),
        );
    }
}