From 6ed6185ca8f6523127508f8062e22a91e0fd6ead Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 5 Dec 2024 15:09:00 -0600 Subject: [PATCH] chore: Upgrade to Bevy 0.15. --- Cargo.toml | 4 +++- src/lib.rs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b7e340b..0cec508 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,9 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bevy = { version = "0.14", default-features = false } +bevy = { version = "0.15", default-features = false, features = [ + "bevy_window", +] } ctrlc = "3" [target.'cfg(windows)'.dependencies] diff --git a/src/lib.rs b/src/lib.rs index 78aefdb..f342e1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,8 @@ -use bevy::{app::AppExit, prelude::*, window::WindowFocused}; +use bevy::{ + app::{AppExit, TerminalCtrlCHandlerPlugin}, + prelude::*, + window::WindowFocused, +}; #[cfg(windows)] use windows::{ core::GUID, @@ -28,7 +32,7 @@ fn setup(mut commands: Commands) { Power::PowerSetActiveScheme(None, Some(active)) .ok() .expect("Failed to set power scheme"); - std::process::exit(1); + TerminalCtrlCHandlerPlugin::gracefully_exit(); }) .expect("Failed to set exit handler"); }