diff --git a/crates/bevy_lunex/Cargo.toml b/crates/bevy_lunex/Cargo.toml index eb3b1a9..09363f1 100644 --- a/crates/bevy_lunex/Cargo.toml +++ b/crates/bevy_lunex/Cargo.toml @@ -12,7 +12,7 @@ [dependencies] bevy = { workspace = true } colored = { workspace = true } - lunex_engine = { workspace = true, features = ["bevy"] } + lunex_engine = { workspace = true } bevy_kira_audio = { workspace = true, optional = true } bevy_mod_picking = { workspace = true } diff --git a/crates/bevy_lunex/src/lib.rs b/crates/bevy_lunex/src/lib.rs index 063c121..54d2b47 100644 --- a/crates/bevy_lunex/src/lib.rs +++ b/crates/bevy_lunex/src/lib.rs @@ -1,4 +1,6 @@ #![doc = include_str!("../README.md")] +#![allow(clippy::type_complexity)] +#![allow(clippy::too_many_arguments)] // #==============================# // #=== IMPORTS FOR THIS CRATE ===# diff --git a/crates/bevy_lunex/src/logic/actions.rs b/crates/bevy_lunex/src/logic/actions.rs index 5f472fd..7817b0a 100644 --- a/crates/bevy_lunex/src/logic/actions.rs +++ b/crates/bevy_lunex/src/logic/actions.rs @@ -187,7 +187,7 @@ pub struct SetUiLayout { fn apply_event_set_ui_layout(mut events: EventReader, mut query: Query<&mut UiLayout>) { for event in events.read() { if let Ok(mut layout) = query.get_mut(event.target) { - if layout.clone() != event.layout{ + if *layout != event.layout{ *layout = event.layout; } } diff --git a/crates/bevy_lunex/src/logic/states.rs b/crates/bevy_lunex/src/logic/states.rs index 34a7f09..a1a4413 100644 --- a/crates/bevy_lunex/src/logic/states.rs +++ b/crates/bevy_lunex/src/logic/states.rs @@ -51,14 +51,7 @@ pub struct UiAnimator { impl UiAnimator { /// Creates new struct pub fn new() -> Self { - UiAnimator { - marker: PhantomData, - animation_direction: -1.0, - animation_transition: 0.0, - receiver: false, - animation_speed_backward: 8.0, - animation_speed_forward: 8.0, - } + Self::default() } /// Marks this hover as receiver pub fn receiver(mut self, receiver: bool) -> Self { @@ -80,6 +73,18 @@ impl UiAnimator { self.animation_direction == 1.0 } } +impl Default for UiAnimator { + fn default() -> Self { + Self { + marker: PhantomData, + animation_direction: -1.0, + animation_transition: 0.0, + receiver: false, + animation_speed_backward: 8.0, + animation_speed_forward: 8.0, + } + } +} fn ui_animation(time: Res