~starkingdoms/starkingdoms

ref: 90fa20b5a97fffd3f5f3bb6c9d8c6586d2ec9692 starkingdoms/crates/unified/src/client/input/util.rs -rw-r--r-- 334 bytes
90fa20b5ghostly_zsh netcode: interpolation is less dumb and stupid; also some ntp left over just in case 5 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)
    }
}