#![allow(clippy::type_complexity)] use async_shared::Value; use bevy::prelude::*; use bevy_defer::ext::picking::{ ClickCancelled, Clicked, LostFocus, ObtainedFocus, Pressed, UIInteractionChange, }; use bevy_defer::reactors::StateMachine; use bevy_defer::AsyncAccess; use bevy_defer::{async_system, async_systems::AsyncSystems, signals::Signals, AsyncPlugin}; use bevy_tasks::futures_lite::StreamExt; use bevy_ui::RelativeCursorPosition; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(AsyncPlugin::default_settings()) .add_systems(Startup, setup) .add_systems(Update, button_system) .run(); } const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15); const HOVERED_BUTTON: Color = Color::srgb(0.25, 0.25, 0.25); const PRESSED_BUTTON: Color = Color::srgb(0.35, 0.75, 0.35); /// from the original fn button_system( mut interaction_query: Query< (&Interaction, &mut BackgroundColor, &mut BorderColor), (Changed, With