From a169c0a52fcefee6cf58cc993a85e6b3b1998ff9 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 9 Jul 2024 11:52:25 +0100 Subject: [PATCH] Add missing button actions (#119) ## Description Allow L or Z to be used in the menu. For instance, could be used to show extra info in the `ROM Info` display. ## Motivation and Context These buttons were not available. ## 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 | 6 ++++++ src/menu/menu_state.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/menu/actions.c b/src/menu/actions.c index 8bb58587..dcabccff 100644 --- a/src/menu/actions.c +++ b/src/menu/actions.c @@ -21,6 +21,8 @@ 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; } static void actions_update_direction (menu_t *menu) { @@ -91,6 +93,10 @@ 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; } } diff --git a/src/menu/menu_state.h b/src/menu/menu_state.h index c2ad221d..5077da4e 100644 --- a/src/menu/menu_state.h +++ b/src/menu/menu_state.h @@ -85,6 +85,8 @@ typedef struct { bool back; bool options; bool settings; + bool l_context; + bool z_context; } actions; struct {