~starkingdoms/starkingdoms

ref: 59f6ec971f5951a53c3d90340e170eef187e4dd7 starkingdoms/crates/unified/src/client/input/util.rs -rw-r--r-- 334 bytes
59f6ec97ghostly_zsh netcode fix: dumb stupid interpolation works when there's no inconsistent delay or loss or reordering of packets 6 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)
    }
}