mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
37 lines
974 B
Rust
37 lines
974 B
Rust
use crate::screens::Screen;
|
|
use bevy::{
|
|
dev_tools::{
|
|
states::log_transitions,
|
|
ui_debug_overlay::{DebugUiPlugin, UiDebugOptions},
|
|
},
|
|
input::common_conditions::input_just_pressed,
|
|
prelude::*,
|
|
};
|
|
use bevy_egui::EguiPlugin;
|
|
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
|
|
|
use super::ui::maze_controls_ui;
|
|
|
|
#[derive(Debug)]
|
|
pub struct DevToolsPlugin;
|
|
|
|
impl Plugin for DevToolsPlugin {
|
|
fn build(&self, app: &mut App) {
|
|
app.add_systems(Update, log_transitions::<Screen>)
|
|
.add_plugins(EguiPlugin)
|
|
.add_plugins(WorldInspectorPlugin::new())
|
|
.add_plugins(DebugUiPlugin)
|
|
.add_systems(Update, maze_controls_ui)
|
|
.add_systems(
|
|
Update,
|
|
toggle_debug_ui.run_if(input_just_pressed(TOGGLE_KEY)),
|
|
);
|
|
}
|
|
}
|
|
|
|
const TOGGLE_KEY: KeyCode = KeyCode::Backquote;
|
|
|
|
fn toggle_debug_ui(mut options: ResMut<UiDebugOptions>) {
|
|
options.toggle();
|
|
}
|