Skip to content
Snippets Groups Projects
events.rs 558 B
Newer Older
sam edelsten's avatar
sam edelsten committed
// File for all events, meant for easy documentation

use bevy::prelude::*;

/// Registers internal events
pub(crate) struct EventsPlugin;
sam edelsten's avatar
sam edelsten committed

impl Plugin for EventsPlugin {
    fn build(&self, app: &mut App) {
        app.add_event::<CosmicTextChanged>()
            .register_type::<CosmicTextChanged>();
/// Text change events
/// Sent when text is changed in a cosmic buffer
sam edelsten's avatar
sam edelsten committed
/// Contains the entity on which the text was changed, and the new text as a [`String`]
#[derive(Event, Reflect, Debug)]
sam edelsten's avatar
sam edelsten committed
pub struct CosmicTextChanged(pub (Entity, String));