DEV Community

Discussion on: Bevy Minesweeper: Tiles and Components

Collapse
 
qongzi profile image
Qongzi

I don't use VS Code so I don't know about the issues with the built in debugger.

About the registry, you are using the old way of registering the components
Are you using the latest version of bevy_inspector_egui ? It should be 0.8.x.
Accessing the inspectable registry is no longer required

Collapse
 
tomuxmon profile image
Tomas Dambrauskas • Edited

hmm. set the version in cargo to version = "~0.8". checked to see that version 0.8.2 is being downloaded. still had the same issue. Got panic:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/tomas/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy-inspector-egui-0.8.2/src/lib.rs:375:14
Enter fullscreen mode Exit fullscreen mode

bevy inspector egui panicked when unwrapping:

impl RegisterInspectable for App {
    fn register_inspectable<T: Inspectable + 'static>(&mut self) -> &mut Self {
        self.world
            .get_resource_mut::<InspectableRegistry>()
            .unwrap() // <-- panic here
            .register::<T>();
        self
    }
}
//..
Enter fullscreen mode Exit fullscreen mode

also. it seems that order of adding world inspector plugin matters (somehow expecting it to be strictly declarative). If I register the plugin at the start like this:

let mut app = App::new();
// Debug hierarchy inspector
#[cfg(feature = "debug")]
app.add_plugin(WorldInspectorPlugin::new());
Enter fullscreen mode Exit fullscreen mode

I get no panic, but sadly I also do not get any world inspector plugin.
If I add the world inspector plugin just before the app run it ends up panicking.

 // Debug hierarchy inspector
#[cfg(feature = "debug")]
app.add_plugin(WorldInspectorPlugin::new());

app.run();
Enter fullscreen mode Exit fullscreen mode

but anyways... registry.register::<T>() work for me so I do not really care at this point :P. Thanks for your time!