1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-10-03 01:34:27 +00:00

Some Quick Menu fixes

This commit is contained in:
jugeeya 2022-03-21 10:03:08 -07:00
parent 491b8f975f
commit 42ab764757
2 changed files with 11 additions and 2 deletions

View file

@ -217,10 +217,15 @@ pub fn handle_get_npad_state(state: *mut NpadGcState, _controller_id: *const u32
// BUTTON_PRESSES.right.is_pressed = (*state).Buttons & ((1 << 14) | (1 << 18)) > 0;
// BUTTON_PRESSES.down.is_pressed = (*state).Buttons & ((1 << 15) | (1 << 19)) > 0;
// BUTTON_PRESSES.up.is_pressed = (*state).Buttons & ((1 << 13) | (1 << 17)) > 0;
if frame_counter::get_frame_count(FRAME_COUNTER_INDEX) != 0 {
return;
}
if (*state).Buttons & (1 << 0) > 0 {
BUTTON_PRESSES.a.is_pressed = true;
}
if (*state).Buttons & (1 << 1) > 0 && frame_counter::get_frame_count(FRAME_COUNTER_INDEX) == 0 {
if (*state).Buttons & (1 << 1) > 0 {
BUTTON_PRESSES.b.is_pressed = true;
}
if (*state).Buttons & (1 << 8) > 0 {

View file

@ -139,6 +139,10 @@ pub fn main() {
log!("No previous menu defaults found.");
}
if is_emulator() {
unsafe { MENU.quick_menu = OnOff::On; }
}
std::thread::spawn(|| loop {
std::thread::sleep(std::time::Duration::from_secs(10));
unsafe {
@ -183,7 +187,7 @@ pub fn main() {
}
});
button_presses.zl.read_press().then(|| app.on_l());
button_presses.zl.read_press().then(|| app.on_r());
button_presses.zr.read_press().then(|| app.on_r());
button_presses.left.read_press().then(|| app.on_left());
button_presses.right.read_press().then(|| app.on_right());
button_presses.up.read_press().then(|| app.on_up());