-
I tried using this crate with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
It works. [dependencies]
bevy = "0.14"
bevy_egui = "0.28"
egui_file = "0.18" use bevy::prelude::*;
use bevy_egui::{EguiContexts, EguiPlugin};
use egui_file::FileDialog;
fn main() {
let mut dialog = FileDialog::open_file(None);
dialog.open();
let ui_example_system = move |mut contexts: EguiContexts| {
dialog.show(contexts.ctx_mut());
};
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(EguiPlugin)
.add_systems(Update, ui_example_system)
.run();
} |
Beta Was this translation helpful? Give feedback.
-
With the introduction of fn main() {
let file_dialog = FileDialog { dialog: None };
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(EguiPlugin)
.add_systems(Startup, setup)
.add_systems(Update, move || { file_dialog })
.run();
} The according compiler error: error[E0277]: `{closure@src/main.rs:160:30: 160:37}` does not describe a valid system configuration
--> src/main.rs:160:30
|
160 | .add_systems(Update, move || { file_dialog })
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^ invalid system configuration
| |
| required by a bound introduced by this call
|
= help: the trait `bevy::prelude::IntoSystem<(), (), _>` is not implemented for closure `{closure@src/main.rs:160:30: 160:37}`
= help: the following other types implement trait `bevy::prelude::IntoSystem<In, Out, Marker>`:
`IntoAdapterSystem<Func, S>` implements `bevy::prelude::IntoSystem<<Func as Adapt<<S as bevy::prelude::IntoSystem<I, O, M>>::System>>::In, <Func as Adapt<<S as bevy::prelude::IntoSystem<I, O, M>>::System>>::Out, (IsAdapterSystemMarker, I, O, M)>`
`IntoPipeSystem<A, B>` implements `bevy::prelude::IntoSystem<IA, OB, (IsPipeSystemMarker, OA, IB, MA, MB)>`
= note: required for `{closure@src/main.rs:160:30: 160:37}` to implement `IntoSystemConfigs<_>`
note: required by a bound in `App::add_systems`
--> $HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.15.1/src/app.rs:288:23
|
285 | pub fn add_systems<M>(
| ----------- required by a bound in this associated function
...
288 | systems: impl IntoSystemConfigs<M>,
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `App::add_systems`
error[E0277]: `impl FnMut(Res<'a, ButtonInput<KeyCode>>, EguiContexts<'b, 'c>, ResMut<'d, Assets<Mesh>>, Single<'e, (&mut Mesh3d, ...)>)` does not describe a valid system configuration
--> src/main.rs:161:31
|
161 | .add_systems(Update, FileDialog::openMesh())
| ----------- ^^^^^^^^^^^^^^^^^^^^^^ invalid system configuration
| |
| required by a bound introduced by this call
|
= note: the full name for the type has been written to '/home/patrick/Coding/BA/target/debug/deps/ba-424857715c0771a0.long-type-2022787241295028123.txt'
= note: consider using `--verbose` to print the full type name to the console
= help: the trait `bevy::prelude::IntoSystem<(), (), _>` is not implemented for `impl FnMut(Res<'a, ButtonInput<KeyCode>>, EguiContexts<'b, 'c>, ResMut<'d, Assets<Mesh>>, Single<'e, (&mut Mesh3d, ...)>)`
= help: the following other types implement trait `bevy::prelude::IntoSystem<In, Out, Marker>`:
`IntoAdapterSystem<Func, S>` implements `bevy::prelude::IntoSystem<<Func as Adapt<<S as bevy::prelude::IntoSystem<I, O, M>>::System>>::In, <Func as Adapt<<S as bevy::prelude::IntoSystem<I, O, M>>::System>>::Out, (IsAdapterSystemMarker, I, O, M)>`
`IntoPipeSystem<A, B>` implements `bevy::prelude::IntoSystem<IA, OB, (IsPipeSystemMarker, OA, IB, MA, MB)>`
= note: required for `impl FnMut(Res<'a, ButtonInput<KeyCode>>, EguiContexts<'b, 'c>, ResMut<'d, Assets<Mesh>>, Single<'e, (&mut Mesh3d, ...)>)` to implement `IntoSystemConfigs<_>`
note: required by a bound in `App::add_systems`
--> $HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.15.1/src/app.rs:288:23
|
285 | pub fn add_systems<M>(
| ----------- required by a bound in this associated function
...
288 | systems: impl IntoSystemConfigs<M>,
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `App::add_systems`
= note: the full name for the type has been written to '/home/patrick/Coding/BA/target/debug/deps/ba-424857715c0771a0.long-type-2022787241295028123.txt'
= note: consider using `--verbose` to print the full type name to the console Changing back to version 0.20 resolves this issue. I'm using bevy_egui version 0.32.0 and bevy version 0.15.1, so the latest. |
Beta Was this translation helpful? Give feedback.
It works.