jakobhellermann / bevy_editor_pls

In-App editor tools for bevy applications
Other
755 stars 78 forks source link

Time stop hotkey doesn't work when the editor panels aren't open #74

Open InnocentusLime opened 1 year ago

InnocentusLime commented 1 year ago

System configuration

OS: Windows 11 (However, it seems that it might be a crossplatform issue) Bevy: 0.10.1 (from crates.io)

rustc --version: rustc 1.68.2 (9eb3afe9e 2023-03-27) rustup default: stable-x86_64-pc-windows-msvc

bevy startup output:

2023-04-16T13:03:12.341333Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon (TM) Graphics", vendor: 4098, device: 5607, device_type: IntegratedGpu, driver: "AMD proprietary driver", driver_info: "21.40.52", backend: Vulkan }
2023-04-16T13:03:13.221788Z  INFO bevy_editor_pls_default_windows::cameras: Spawning editor cameras
2023-04-16T13:03:13.827399Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Pro", kernel: "22621", cpu: "AMD Ryzen 7 5825U with Radeon Graphics", core_count: "8", memory: "14.8 GiB" }

What versions have this issue

This problem happens with bevy_editor_pls 0.4 and the latest version on the main branch on github (f202123bd91ac94a1c42f5399c8c79533bd4e082).

The issue

When I launch this program and press the time pause hotkey -- LCtrl + Return -- the sprite keeps flickering. At the same time, it looks as if the input wasn't dropped, because the Pause time box in the Debug settings does get checked

"pause time" box is checked

Code to reproduce the issue

use bevy::prelude::*;
use bevy_editor_pls::EditorPlugin;

fn startup(
    asset_server: Res<AssetServer>,
    mut commands: Commands,
) {
    commands.spawn(Camera2dBundle::default());
    commands.spawn(SpriteBundle {
        texture: asset_server.load("bevy.png"),
        ..default()
    });
}

fn tick(
    time: Res<Time>,
    mut sprite_q: Query<&mut Sprite>,
) {
    let secs = time.elapsed_seconds();
    let evenness = (secs * 2.0f32) as i32 % 2;
    sprite_q.single_mut().color.set_b(evenness as f32);
    sprite_q.single_mut().color.set_g(evenness as f32);
}

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(EditorPlugin::default())
        .add_startup_system(startup)
        .add_system(tick)
        .run();
}