Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Apr 1, 2024
1 parent 460fcb1 commit a01f86f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/game/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl Plugin for GameButtonPlugin {
}
}

#[allow(clippy::type_complexity)]
fn button_system(
mut query: Query<
(&Interaction, &mut BackgroundColor, &mut BorderColor),
Expand All @@ -39,15 +40,15 @@ fn button_system(
match *interaction {
Interaction::Pressed => {
*color = config::PRESSED_BUTTON.into();
border_color.0 = config::BUTTON_BORDER_COLOR.into();
border_color.0 = config::BUTTON_BORDER_COLOR;
}
Interaction::Hovered => {
*color = config::HOVERED_BUTTON.into();
border_color.0 = config::BUTTON_BORDER_COLOR.into();
border_color.0 = config::BUTTON_BORDER_COLOR;
}
Interaction::None => {
*color = config::NORMAL_BUTTON.into();
border_color.0 = config::BUTTON_BORDER_COLOR.into();
border_color.0 = config::BUTTON_BORDER_COLOR;
}
}
}
Expand All @@ -60,12 +61,12 @@ fn button_shortcut_system(
for (mut color, mut border_color, shortcut) in &mut query {
if keyboard_input.pressed(shortcut.0) {
*color = config::PRESSED_BUTTON.into();
border_color.0 = config::PRESSED_BUTTON_BORDER_COLOR.into();
border_color.0 = config::PRESSED_BUTTON_BORDER_COLOR;
}

if keyboard_input.just_released(shortcut.0) {
*color = config::NORMAL_BUTTON.into();
border_color.0 = config::BUTTON_BORDER_COLOR.into();
border_color.0 = config::BUTTON_BORDER_COLOR;
}
}
}
3 changes: 2 additions & 1 deletion src/game/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ fn setup(
fn timer_system(time: Res<Time>, mut query: Query<(&mut CueTimer, &GameState)>) {
if let Ok((mut timer, state)) = query.get_single_mut() {
if *state == GameState::Playing {
if timer.tick(time.delta()).just_finished() {
timer.tick(time.delta());
if timer.just_finished() {
info!("tick!")
}
}
Expand Down

0 comments on commit a01f86f

Please sign in to comment.