jakobhellermann / bevy-inspector-egui

Inspector plugin for the bevy game engine
Apache License 2.0
1.19k stars 173 forks source link

Re-export `bevy_egui::EguiContext` as well? #2

Closed twitchyliquid64 closed 3 years ago

twitchyliquid64 commented 3 years ago

Hi!

I managed to get bevy-inspector-egui to play nicely with mouse interaction outside of the GUI, by checking CtxRef::wants_mouse_input() and disabling mouse interactivity for the camera, picker etc. Like this:

// system
fn data_ui(
    egui: Res<bevy_egui::EguiContext>,
    mut cameras: Query<&mut CameraRig>,
) {
    for mut c in cameras.iter_mut() {
        c.disable = egui.ctx.wants_mouse_input();
    }
}

The problem is that bevy-inspector-egui does not re-export bevy_egui::EguiContext, so I have to import the crate manually. This means that there are potentially two versions of bevy_egui which can get out of sync.

To support this use-case, could this crate re-export bevy_egui::EguiContext ? I see it already re-exports bevy_egui::egui;

Thanks! Tom

jakobhellermann commented 3 years ago

That seems reasonable to me. I reexported the whole bevy_egui here.

jakobhellermann commented 3 years ago

The reexport is published with version 0.3.0.

twitchyliquid64 commented 3 years ago

THANK YOU!!! ❤️