|
|
|
|
@ -21,9 +21,6 @@ impl Plugin for UiPlugin {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Component)]
|
|
|
|
|
struct UiRoot;
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Resource)]
|
|
|
|
|
pub(crate) struct UiFont {
|
|
|
|
|
pub handle: Handle<Font>,
|
|
|
|
|
@ -85,35 +82,32 @@ fn interactive_button(
|
|
|
|
|
.for_each(|(entity, mut ui_image, interaction)| match interaction {
|
|
|
|
|
Interaction::None => {
|
|
|
|
|
ui_image.texture = resting_handle.clone();
|
|
|
|
|
texts
|
|
|
|
|
.iter_many_mut(children.iter_descendants(entity))
|
|
|
|
|
.for_each(|(mut t, mut s)| {
|
|
|
|
|
s.right = Val::Auto;
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
});
|
|
|
|
|
let mut ts = texts.iter_many_mut(children.iter_descendants(entity));
|
|
|
|
|
while let Some((mut t, mut s)) = ts.fetch_next() {
|
|
|
|
|
s.right = Val::Auto;
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Interaction::Hovered => {
|
|
|
|
|
ui_image.texture = depressed_handle.clone();
|
|
|
|
|
writer.send(audio::AudioEvent::MenuHover);
|
|
|
|
|
texts
|
|
|
|
|
.iter_many_mut(children.iter_descendants(entity))
|
|
|
|
|
.for_each(|(mut t, mut s)| {
|
|
|
|
|
s.right = Val::Px(0.0);
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
});
|
|
|
|
|
let mut ts = texts.iter_many_mut(children.iter_descendants(entity));
|
|
|
|
|
while let Some((mut t, mut s)) = ts.fetch_next() {
|
|
|
|
|
s.right = Val::Px(0.0);
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Interaction::Pressed => {
|
|
|
|
|
ui_image.texture = depressed_handle.clone();
|
|
|
|
|
writer.send(audio::AudioEvent::MenuSelect);
|
|
|
|
|
texts
|
|
|
|
|
.iter_many_mut(children.iter_descendants(entity))
|
|
|
|
|
.for_each(|(mut t, mut s)| {
|
|
|
|
|
s.right = Val::Px(0.0);
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
});
|
|
|
|
|
let mut ts = texts.iter_many_mut(children.iter_descendants(entity));
|
|
|
|
|
while let Some((mut t, mut s)) = ts.fetch_next() {
|
|
|
|
|
s.right = Val::Px(0.0);
|
|
|
|
|
info!("TODO: Change text color");
|
|
|
|
|
info!("TODO: Change position");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|