~starkingdoms/starkingdoms

ref: 02e7f65abd9f13361fff020bd4c4e9df6df3f91c starkingdoms/crates/unified/src/client/input/util.rs -rw-r--r-- 334 bytes
02e7f65aghostly_zsh fix: starfield is now changing mode to stop unreasonable computations 22 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
use leafwing_input_manager::Actionlike;
use leafwing_input_manager::prelude::ActionState;

pub trait ActionStateExt<A> {
    fn button_changed(&self, a: &A) -> bool;
}
impl<A: Actionlike> ActionStateExt<A> for ActionState<A> {
    fn button_changed(&self, a: &A) -> bool {
        self.just_pressed(a) || self.just_released(a)
    }
}