1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-28 04:44:06 +00:00

Refactor input_delay from i32 to Delay (#386)

* Change input_delay to use Delay structure instead of i32

* Update input_delay.rs
This commit is contained in:
asimon-1 2022-10-06 16:03:41 -07:00 committed by GitHub
parent 7bbae26f35
commit bbc0c93c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -29,7 +29,7 @@ pub fn handle_get_npad_state(state: *mut NpadGcState, controller_id: *const u32)
let mut delayed_states = P1_DELAYED_NPAD_STATES.lock();
let actual_state = *state;
if delayed_states.len() < MENU.input_delay as usize {
if delayed_states.len() < MENU.input_delay.into_delay() as usize {
let update_count = (*state).updateCount;
*state = NpadGcState::default();
(*state).updateCount = update_count;
@ -40,7 +40,7 @@ pub fn handle_get_npad_state(state: *mut NpadGcState, controller_id: *const u32)
}
delayed_states.push_front(actual_state);
delayed_states.truncate(MENU.input_delay as usize);
delayed_states.truncate(MENU.input_delay.into_delay() as usize);
}
}
}

View file

@ -1019,7 +1019,7 @@ pub struct TrainingModpackMenu {
pub frame_advantage: OnOff,
pub full_hop: BoolFlag,
pub hitbox_vis: OnOff,
pub input_delay: i32,
pub input_delay: Delay,
pub ledge_delay: LongDelay,
pub ledge_state: LedgeOption,
pub mash_state: Action,
@ -1082,7 +1082,7 @@ impl TrainingModpackMenu {
follow_up = Action::from_bits(val),
full_hop = BoolFlag::from_bits(val),
hitbox_vis = OnOff::from_val(val),
input_delay = Some(log_2(val) as i32),
input_delay = Delay::from_bits(val),
ledge_delay = LongDelay::from_bits(val),
ledge_state = LedgeOption::from_bits(val),
mash_state = Action::from_bits(val),
@ -1159,7 +1159,7 @@ pub static DEFAULTS_MENU: TrainingModpackMenu = TrainingModpackMenu {
frame_advantage: OnOff::Off,
full_hop: BoolFlag::empty(),
hitbox_vis: OnOff::On,
input_delay: 0,
input_delay: Delay::D0,
ledge_delay: LongDelay::empty(),
ledge_state: LedgeOption::all(),
mash_state: Action::empty(),