pub struct YoleckExclusiveSystemsQueue(/* private fields */);
Expand description
The currently pending exclusive systems.
Other edit systems (exclusive or otherwise) may push_back
exclusive edit
systems into this queue:
fn regular_edit_system(
edit: YoleckEdit<(), With<LookingAt2D>>,
mut ui: ResMut<YoleckUi>,
mut exclusive_queue: ResMut<YoleckExclusiveSystemsQueue>,
) {
if edit.single().is_err() {
return;
}
if ui.button("Look At").clicked() {
exclusive_queue.push_back(exclusive_system);
}
}
fn exclusive_system(
mut edit: YoleckEdit<&mut LookingAt2D>,
// Getting the actual input is still quite manual. May be chanced in the future.
cameras_query: Query<&VpeolCameraState>,
ui: ResMut<YoleckUi>,
buttons: Res<ButtonInput<MouseButton>>,
) -> YoleckExclusiveSystemDirective {
let Ok(mut looking_at) = edit.single_mut() else {
return YoleckExclusiveSystemDirective::Finished;
};
let Some(cursor_ray) = cameras_query.iter().find_map(|camera_state| camera_state.cursor_ray) else {
return YoleckExclusiveSystemDirective::Listening;
};
looking_at.0 = cursor_ray.origin.truncate();
if ui.ctx().is_pointer_over_area() {
return YoleckExclusiveSystemDirective::Listening;
}
if buttons.just_released(MouseButton::Left) {
return YoleckExclusiveSystemDirective::Finished;
}
return YoleckExclusiveSystemDirective::Listening;
}
Implementations§
Source§impl YoleckExclusiveSystemsQueue
impl YoleckExclusiveSystemsQueue
Sourcepub fn push_back<P>(
&mut self,
system: impl IntoSystem<(), YoleckExclusiveSystemDirective, P>,
)
pub fn push_back<P>( &mut self, system: impl IntoSystem<(), YoleckExclusiveSystemDirective, P>, )
Add an exclusive system to be ran starting from the next frame.
If there are already exclusive systems running or enqueued, the new one will run after they finish.
Sourcepub fn push_front<P>(
&mut self,
system: impl IntoSystem<(), YoleckExclusiveSystemDirective, P>,
)
pub fn push_front<P>( &mut self, system: impl IntoSystem<(), YoleckExclusiveSystemDirective, P>, )
Add an exclusive system to be ran starting from the next frame.
If there are already exclusive systems enqueued, the new one will run before them. If there is an exclusive system already running, the new one will only run after it finishes.
Trait Implementations§
Source§impl Default for YoleckExclusiveSystemsQueue
impl Default for YoleckExclusiveSystemsQueue
Source§fn default() -> YoleckExclusiveSystemsQueue
fn default() -> YoleckExclusiveSystemsQueue
Returns the “default value” for a type. Read more
impl Resource for YoleckExclusiveSystemsQueue
Auto Trait Implementations§
impl Freeze for YoleckExclusiveSystemsQueue
impl !RefUnwindSafe for YoleckExclusiveSystemsQueue
impl Send for YoleckExclusiveSystemsQueue
impl Sync for YoleckExclusiveSystemsQueue
impl Unpin for YoleckExclusiveSystemsQueue
impl !UnwindSafe for YoleckExclusiveSystemsQueue
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more