From d8b38e94443469157ac61b9c2501cf1c31fe9650 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 3 Jan 2025 13:41:18 -0500 Subject: [PATCH] fix: Actually integrate Bevy 0.15's handling for `ctrlc`. --- Cargo.toml | 1 - src/lib.rs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b01cc9..1a65788 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ edition = "2021" bevy = { version = "0.15", default-features = false, features = [ "bevy_window", ] } -ctrlc = "3" [target.'cfg(windows)'.dependencies] windows = { version = "0.58", features = [ diff --git a/src/lib.rs b/src/lib.rs index f8d02ed..d945794 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +use bevy::app::ctrlc; #[allow(unused_imports)] use bevy::{ app::{AppExit, TerminalCtrlCHandlerPlugin}, @@ -88,7 +89,8 @@ pub struct FullThrottlePlugin { impl Plugin for FullThrottlePlugin { fn build(&self, app: &mut App) { - app.insert_resource(*self) + app.add_plugins(TerminalCtrlCHandlerPlugin) + .insert_resource(*self) .add_systems(Startup, setup) .add_systems(PostUpdate, (focus_change, exit)); }