bevy_asky 0.5.0

A simple question-and-answer UI middleware for Bevy
Documentation
use bevy::prelude::*;
use bevy_asky::prelude::*;
use bevy_defer::{AsyncCommandsExtension, AsyncPlugin};

#[path = "../common/lib.rs"]
mod common;
use common::View;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, AskyPlugin, AsyncPlugin::default_settings()))
        .add_plugins(common::views)
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands, mut asky: AskyAsync) {
    // UI camera
    commands.spawn(Camera2d::default());

    // TODO: This one is still not right. Focus doesn't move down.
    let id = commands.column().id();
    commands.spawn_task(move || async move {
        let response: Result<String, Error> = asky
            .prompt::<Add0<TextField, View>>("What up? ", Dest::ReplaceChildren(id))
            .await;
        let _ = dbg!(response);

        let response: Result<String, Error> = asky
            .prompt::<Add0<TextField, View>>("Really? ", Dest::ReplaceChildren(id))
            .await;
        let _ = dbg!(response);
        Ok(())
    });
}