2023-02-11 17:07:29 -08:00
|
|
|
use std::collections::VecDeque;
|
|
|
|
|
2023-08-10 07:28:13 -07:00
|
|
|
use crate::common::input::*;
|
2020-09-14 13:43:06 -07:00
|
|
|
use lazy_static::lazy_static;
|
|
|
|
use parking_lot::Mutex;
|
2023-02-11 17:07:29 -08:00
|
|
|
|
|
|
|
use crate::common::MENU;
|
2020-09-14 13:43:06 -07:00
|
|
|
|
|
|
|
lazy_static! {
|
2023-08-10 07:28:13 -07:00
|
|
|
static ref P1_DELAYED_INPUT_MAPPINGS: Mutex<VecDeque<MappedInputs>> =
|
|
|
|
Mutex::new(VecDeque::new());
|
2020-09-14 13:43:06 -07:00
|
|
|
}
|
|
|
|
|
2023-08-10 07:28:13 -07:00
|
|
|
pub fn handle_final_input_mapping(player_idx: i32, out: *mut MappedInputs) {
|
2021-08-20 18:48:40 +00:00
|
|
|
unsafe {
|
2023-08-10 07:28:13 -07:00
|
|
|
if player_idx == 0 {
|
|
|
|
let mut delayed_mappings = P1_DELAYED_INPUT_MAPPINGS.lock();
|
|
|
|
let actual_mapping = *out;
|
|
|
|
|
|
|
|
if delayed_mappings.len() < MENU.input_delay.into_delay() as usize {
|
|
|
|
*out = MappedInputs::empty();
|
|
|
|
} else if let Some(delayed_mapping) = delayed_mappings.back() {
|
|
|
|
*out = *delayed_mapping;
|
2021-08-20 18:48:40 +00:00
|
|
|
}
|
Add UI backing to text options in menu, always do new damage display (#451)
* A bunch of things
* Current progress
* Fix for ResAnimationContent
* Figure out Parts*
* Cleanup, just because
* New pane working!!!
* New null pane for hierarchy
* Success with parent pane
* Generate multiple panes
* Multiple panes, almost working text color
* MaterialColor test, but fails
* Forgot bitfield-struct
* Vtable for material. Fixes SetWhiteColor!
* Refactor color changing, change naming scheme
* Just Frame Advantage
* Merge
* Delete T_test.txt
* Delete set_txt_num_01.txt
* Delete libtraining_modpack.nro
* Format Rust code using rustfmt
* Ignore shell scripts in repo languages
* General refactor, add basis for quick menu
* Small refactor, fix ordering of submenu options
* Toggles, sliders
* Tons of progress...
* Correct dmg updater, remove old quick menu backend
* Fix damage percentage display
* Small QoL
* Format Rust code using rustfmt
* More edits. Use Quit Training button as Modpack Menu header
* Finish merge
* Format Rust code using rustfmt
* Use vanilla backgrounds for text options
* Format ui_hacks, also always do new percent display
* Fix merge
* That was the most awful merge ever
* Address clippy warnings
* Format Rust code using rustfmt
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-30 11:33:17 -08:00
|
|
|
|
2023-08-10 07:28:13 -07:00
|
|
|
delayed_mappings.push_front(actual_mapping);
|
|
|
|
delayed_mappings.truncate(MENU.input_delay.into_delay() as usize);
|
2021-08-20 18:48:40 +00:00
|
|
|
}
|
2020-09-14 13:43:06 -07:00
|
|
|
}
|
2021-09-14 14:05:48 -07:00
|
|
|
}
|