Skip to content

Commit

Permalink
remove close_on_esc (#12859)
Browse files Browse the repository at this point in the history
# Objective

- Remove `close_on_esc`
- For context about why we are removing it see:
[discord](https://discordapp.com/channels/691052431525675048/692572690833473578/1225075194524073985)

## Migration Guide

- Users who added `close_on_esc` in their application will have to
replace it with their own solution.

```rust
pub fn close_on_esc(
    mut commands: Commands,
    focused_windows: Query<(Entity, &Window)>,
    input: Res<ButtonInput<KeyCode>>,
) {
    for (window, focus) in focused_windows.iter() {
        if !focus.focused {
            continue;
        }

        if input.just_pressed(KeyCode::Escape) {
            commands.entity(window).despawn();
        }
    }
}
```
  • Loading branch information
matiqo15 committed Apr 3, 2024
1 parent f516de4 commit 6ccb2a3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
32 changes: 0 additions & 32 deletions crates/bevy_dev_tools/src/close_on_esc.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/bevy_dev_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ pub mod fps_overlay;
#[cfg(feature = "bevy_ui_debug")]
pub mod ui_debug_overlay;

mod close_on_esc;

pub use crate::close_on_esc::close_on_esc;

/// Enables developer tools in an [`App`]. This plugin is added automatically with `bevy_dev_tools`
/// feature.
///
Expand Down

0 comments on commit 6ccb2a3

Please sign in to comment.