Compare commits

..

4 commits

5 changed files with 37 additions and 7 deletions

View file

@ -1,4 +1,10 @@
# v0.12.0-dev
# v0.13.0-dev
- Reduce power usage when the menu is open or the window is unfocused
- Add sparkles to Jupiter's ring ✨😍✨ best visible from Farview Station
- Add oxygen tank near Luna's workshop, refills oxygen on interaction
# v0.12.0
- Overhaul pizzeria asteroid
- Implement thruster particle effects (only in AR, as they'd be invisble in RL)

2
Cargo.lock generated
View file

@ -3039,7 +3039,7 @@ dependencies = [
[[package]]
name = "outfly"
version = "0.12.0"
version = "0.13.0-dev"
dependencies = [
"bevy",
"bevy_embedded_assets",

View file

@ -10,7 +10,7 @@
[package]
name = "outfly"
version = "0.12.0"
version = "0.13.0-dev"
edition = "2021"
homepage = "https://codeberg.org/outfly/outfly"
repository = "https://codeberg.org/outfly/outfly"

View file

@ -619,7 +619,9 @@ fn check_achievements(
}
fn handle_window_focus(
mut local_paused: Local<bool>,
mut settings: ResMut<Settings>,
mut q_window: Query<&mut Window, With<PrimaryWindow>>,
mut er_focus: EventReader<bevy::window::WindowFocused>,
mut physicstime: ResMut<Time<Physics>>,
) {
@ -627,9 +629,23 @@ fn handle_window_focus(
settings.window_focused = event.focused;
}
if settings.is_game_running() {
physicstime.unpause();
} else {
let paused = !settings.is_game_running();
if paused != *local_paused {
if paused {
physicstime.pause();
} else {
physicstime.unpause();
}
for mut window in &mut q_window {
window.cursor.grab_mode = if paused {
bevy::window::CursorGrabMode::None
} else {
bevy::window::CursorGrabMode::Locked
};
window.cursor.visible = paused;
}
*local_paused = paused;
}
}

View file

@ -115,6 +115,14 @@ fn main() {
mode: bevy_embedded_assets::PluginMode::ReplaceDefault,
});
// Reduce power usage when unfocused
app.insert_resource(bevy::winit::WinitSettings {
focused_mode: bevy::winit::UpdateMode::Continuous,
unfocused_mode: bevy::winit::UpdateMode::reactive_low_power(
bevy::utils::Duration::from_secs(10),
),
});
app.add_plugins(OutFlyPlugin);
app.insert_resource(prefs);
app.run();