We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding criteria for plugins. I use a plugin for camera movement which I wanted to disable on egui widgets. The plugin consists of 2 systems.
app.add_system(camera_movement).add_system(camera_zoom);
I would like to use the plugin with ability to restrict it.
fn disable_on_egui_widget(mut egui_ctx: ResMut<EguiContext>) -> ShouldRun { if egui_ctx.ctx_mut().wants_pointer_input() || egui_ctx.ctx_mut().wants_keyboard_input() || egui_ctx.ctx_mut().is_pointer_over_area() { ShouldRun::No } else { ShouldRun::Yes } } app .add_plugin_with_criterium(PanCamPlugin, disable_on_egui_widget)
where criterium is some other system.
The solution I found is I had to copy plugin code to my project and add these conditions in
fn camera_zoom( mut egui_ctx: ResMut<EguiContext>, mut query: Query<(&PanCam, &mut OrthographicProjection)>, mut scroll_events: EventReader<MouseWheel>, ) { // added condition to the system if egui_ctx.ctx_mut().wants_pointer_input() || egui_ctx.ctx_mut().wants_keyboard_input() || egui_ctx.ctx_mut().is_pointer_over_area() { return; } }
Which is not ideal because I don't want to copy plugins into my project only to restrict when they run.
The text was updated successfully, but these errors were encountered:
Very much agree with this being a problem.
However, I'm going to close this as a duplicate of #2160 to keep the discussion centralized :)
Sorry, something went wrong.
@alice-i-cecile No problem. I will track the issue you mentioned.
No branches or pull requests
What problem does this solve or what need does it fill?
Adding criteria for plugins. I use a plugin for camera movement which I wanted to disable on egui widgets. The plugin consists of 2 systems.
app.add_system(camera_movement).add_system(camera_zoom);
What solution would you like?
I would like to use the plugin with ability to restrict it.
where criterium is some other system.
What alternative(s) have you considered?
The solution I found is I had to copy plugin code to my project and add these conditions in
Which is not ideal because I don't want to copy plugins into my project only to restrict when they run.
The text was updated successfully, but these errors were encountered: