upgrade bevy_mod_picking
This commit is contained in:
parent
54972b7cf7
commit
4449bacaa1
|
@ -10,8 +10,9 @@ members = ["ray_format"]
|
|||
[dependencies]
|
||||
anyhow = "1.0.71"
|
||||
bevy = { version = "0.10.1" }
|
||||
bevy_eventlistener = "0.2.2"
|
||||
bevy_framepace = "0.12.1"
|
||||
bevy_mod_picking = { git = "https://github.com/aevyrie/bevy_mod_picking/", branch = "ui-fix", default-features = false, features = ["backend_bevy_ui", "debug"] }
|
||||
bevy_mod_picking = { version = "0.14", default-features = false, features = ["backend_bevy_ui", "debug"] }
|
||||
bevy_mod_scripting = { version = "0.3.0", features = ["rhai"] }
|
||||
bevy_ninepatch = "0.10.0"
|
||||
bevy_tweening = "0.7.0"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::{collections::HashMap, marker::PhantomData, time::Duration};
|
||||
|
||||
use bevy::prelude::*;
|
||||
use bevy_eventlistener::callbacks::ListenerInput;
|
||||
use bevy_mod_picking::prelude::*;
|
||||
use bevy_ninepatch::*;
|
||||
use bevy_tweening::{lens::UiPositionLens, *};
|
||||
|
@ -32,8 +33,8 @@ pub struct ArrowDrag<C: Component> {
|
|||
_data: PhantomData<C>,
|
||||
}
|
||||
|
||||
impl<C: Component> From<ListenedEvent<Drag>> for ArrowDrag<C> {
|
||||
fn from(value: ListenedEvent<Drag>) -> Self {
|
||||
impl<C: Component> From<ListenerInput<Pointer<Drag>>> for ArrowDrag<C> {
|
||||
fn from(value: ListenerInput<Pointer<Drag>>) -> Self {
|
||||
ArrowDrag {
|
||||
target: value.target,
|
||||
delta: value.delta,
|
||||
|
@ -184,7 +185,9 @@ pub(super) fn spawn_levels(
|
|||
..default()
|
||||
})
|
||||
.insert(MicLevelArrow)
|
||||
.insert(OnPointer::<Drag>::send_event::<ArrowDrag<MicLevelArrow>>());
|
||||
.insert(
|
||||
On::<Pointer<Drag>>::send_event::<ArrowDrag<MicLevelArrow>>(),
|
||||
);
|
||||
parent
|
||||
.spawn(NinePatchBundle {
|
||||
style: Style {
|
||||
|
@ -202,35 +205,37 @@ pub(super) fn spawn_levels(
|
|||
.insert(MicLevelContainer);
|
||||
});
|
||||
});
|
||||
parent.spawn(NodeBundle {
|
||||
style: Style {
|
||||
flex_direction: FlexDirection::Column,
|
||||
gap: Size::height(Val::Px(10.)),
|
||||
..default()
|
||||
} ,
|
||||
..default()
|
||||
}).with_children(|parent| {
|
||||
parent.spawn(ImageBundle {
|
||||
image: UiImage::new(ass.load("lips.png")),
|
||||
background_color: Color::BLACK.into(),
|
||||
..default()
|
||||
});
|
||||
let mut content = HashMap::new();
|
||||
content.insert((), active_bar);
|
||||
parent.spawn(NinePatchBundle {
|
||||
parent
|
||||
.spawn(NodeBundle {
|
||||
style: Style {
|
||||
size: Size::new(Val::Px(32.), Val::Percent(100.)),
|
||||
..default()
|
||||
},
|
||||
nine_patch_data: NinePatchData {
|
||||
texture: bar_img.clone(),
|
||||
nine_patch: bar_patch.clone(),
|
||||
content: Some(content),
|
||||
flex_direction: FlexDirection::Column,
|
||||
gap: Size::height(Val::Px(10.)),
|
||||
..default()
|
||||
},
|
||||
..default()
|
||||
})
|
||||
.with_children(|parent| {
|
||||
parent.spawn(ImageBundle {
|
||||
image: UiImage::new(ass.load("lips.png")),
|
||||
background_color: Color::BLACK.into(),
|
||||
..default()
|
||||
});
|
||||
let mut content = HashMap::new();
|
||||
content.insert((), active_bar);
|
||||
parent.spawn(NinePatchBundle {
|
||||
style: Style {
|
||||
size: Size::new(Val::Px(32.), Val::Percent(100.)),
|
||||
..default()
|
||||
},
|
||||
nine_patch_data: NinePatchData {
|
||||
texture: bar_img.clone(),
|
||||
nine_patch: bar_patch.clone(),
|
||||
content: Some(content),
|
||||
..default()
|
||||
},
|
||||
..default()
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue