use bevy::{app::PluginGroupBuilder, prelude::*};
use crate::{error, event, kitty, mouse, terminal};
pub struct RatatuiPlugins {
pub enable_kitty_protocol: bool,
pub enable_mouse_capture: bool,
}
impl Default for RatatuiPlugins {
fn default() -> Self {
Self {
enable_kitty_protocol: true,
enable_mouse_capture: false,
}
}
}
impl PluginGroup for RatatuiPlugins {
fn build(self) -> PluginGroupBuilder {
let mut builder = PluginGroupBuilder::start::<Self>()
.add(error::ErrorPlugin)
.add(terminal::TerminalPlugin)
.add(event::EventPlugin);
if self.enable_kitty_protocol {
builder = builder.add(kitty::KittyPlugin);
}
if self.enable_mouse_capture {
builder = builder.add(mouse::MousePlugin);
}
builder
}
}