From fa4bdbbfb94acff02739d8820e7c706caf621a39 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 13 Jul 2024 22:18:33 +0100 Subject: [PATCH] Merge L and Z button action (#120) ## Description Merge the L and Z action to be the "same" button press, depending on how the joypad is gripped. ## Motivation and Context Simplifies the menu controls. https://github.com/Polprzewodnikowy/N64FlashcartMenu/pull/119#issuecomment-2218853256 ## How Has This Been Tested? ## Screenshots ## Types of changes - [x] Improvement (non-breaking change that adds a new feature) - [ ] Bug fix (fixes an issue) - [ ] Breaking change (breaking change) - [ ] Config and build (change in the configuration and build system, has no impact on code or features) ## Checklist: - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Signed-off-by: GITHUB_USER --- src/menu/actions.c | 9 +++------ src/menu/menu_state.h | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/menu/actions.c b/src/menu/actions.c index dcabccff..14c87fb6 100644 --- a/src/menu/actions.c +++ b/src/menu/actions.c @@ -21,8 +21,7 @@ static void actions_clear (menu_t *menu) { menu->actions.back = false; menu->actions.options = false; menu->actions.settings = false; - menu->actions.l_context = false; - menu->actions.z_context = false; + menu->actions.lz_context = false; } static void actions_update_direction (menu_t *menu) { @@ -93,10 +92,8 @@ static void actions_update_buttons (menu_t *menu) { menu->actions.options = true; } else if (pressed.start) { menu->actions.settings = true; - } else if (pressed.l) { - menu->actions.l_context = true; - } else if (pressed.z) { - menu->actions.z_context = true; + } else if (pressed.l || pressed.z) { + menu->actions.lz_context = true; } } diff --git a/src/menu/menu_state.h b/src/menu/menu_state.h index 5077da4e..0d6aa459 100644 --- a/src/menu/menu_state.h +++ b/src/menu/menu_state.h @@ -85,8 +85,7 @@ typedef struct { bool back; bool options; bool settings; - bool l_context; - bool z_context; + bool lz_context; } actions; struct {