diff --git a/src/cursor.rs b/src/cursor.rs index f54fef69fdd8a5b2c728f236aa98bd98207e9089..27354b77cf5b9cd69b140124d5ec7d98d078fcd2 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -10,11 +10,20 @@ pub struct CursorSet; pub struct CursorPlugin; +/// Unit resource whose existence in the world disables the cursor plugin systems. +#[derive(Resource)] +pub struct CursorPluginDisabled; + impl Plugin for CursorPlugin { fn build(&self, app: &mut App) { - app.add_systems(Update, ((hover_sprites, hover_ui), change_cursor).chain()) - .add_event::<TextHoverIn>() - .add_event::<TextHoverOut>(); + app.add_systems( + Update, + ((hover_sprites, hover_ui), change_cursor) + .chain() + .run_if(not(resource_exists::<CursorPluginDisabled>)), + ) + .add_event::<TextHoverIn>() + .add_event::<TextHoverOut>(); } }