bevy_ui_builders/button/
plugin.rs1use bevy::prelude::*;
4use bevy_plugin_builder::define_plugin;
5use super::systems::{
6 handle_hover_scale,
7 handle_hover_brightness,
8 handle_button_interaction,
9 animate_button_transitions,
10 auto_toggle_selectable_buttons,
11 enforce_exclusive_button_groups,
12 update_selection_appearance,
13 apply_selection_colors_immediately,
14};
15use super::types::SelectionChanged;
16
17define_plugin!(ButtonPlugin {
19 custom_init: |app: &mut App| {
20 app.add_message::<SelectionChanged>();
22 },
23 update: [
24 (
26 (enforce_exclusive_button_groups, auto_toggle_selectable_buttons),
28 update_selection_appearance,
30 apply_selection_colors_immediately,
32 ).chain(),
33
34 (handle_button_interaction, animate_button_transitions).chain(),
36
37 (handle_hover_scale, handle_hover_brightness),
39 ]
40});