mirror of
https://github.com/kristoferssolo/maze-ascension.git
synced 2025-10-21 19:20:34 +00:00
refactor(devt-tools): remove custom inspector
This commit is contained in:
parent
9ecb38b442
commit
1a0a859fec
@ -8,9 +8,9 @@ use bevy::{
|
||||
prelude::*,
|
||||
};
|
||||
use bevy_egui::EguiPlugin;
|
||||
use bevy_inspector_egui::DefaultInspectorConfigPlugin;
|
||||
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||
|
||||
use super::ui::{inspector_ui, maze_controls_ui};
|
||||
use super::ui::maze_controls_ui;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct DevToolsPlugin;
|
||||
@ -19,9 +19,9 @@ 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_plugins(DefaultInspectorConfigPlugin)
|
||||
.add_systems(Update, (inspector_ui, maze_controls_ui))
|
||||
.add_systems(Update, maze_controls_ui)
|
||||
.add_systems(
|
||||
Update,
|
||||
toggle_debug_ui.run_if(input_just_pressed(TOGGLE_KEY)),
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
use bevy::{prelude::*, window::PrimaryWindow};
|
||||
use bevy_egui::egui::{self, ScrollArea};
|
||||
use bevy_inspector_egui::bevy_egui::EguiContext;
|
||||
|
||||
pub(crate) fn inspector_ui(world: &mut World) {
|
||||
let Ok(egui_context) = world
|
||||
.query_filtered::<&mut EguiContext, With<PrimaryWindow>>()
|
||||
.get_single(world)
|
||||
else {
|
||||
return;
|
||||
};
|
||||
|
||||
let mut egui_context = egui_context.clone();
|
||||
|
||||
egui::Window::new("UI").show(egui_context.get_mut(), |ui| {
|
||||
ScrollArea::vertical().show(ui, |ui| {
|
||||
bevy_inspector_egui::bevy_inspector::ui_for_world(world, ui);
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -1,5 +1,3 @@
|
||||
mod inspector;
|
||||
mod maze_controls;
|
||||
|
||||
pub(crate) use inspector::inspector_ui;
|
||||
pub(crate) use maze_controls::maze_controls_ui;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user