fix: Actually integrate Bevy 0.15's handling for ctrlc.

This commit is contained in:
Nolan Darilek 2025-01-03 13:41:18 -05:00
parent ffa9746323
commit d8b38e9444
2 changed files with 3 additions and 2 deletions

View File

@ -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 = [

View File

@ -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));
}