From 1b61b88274e5cab63bd6fd27a0bcf9dbe41b8b38 Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Sun, 11 May 2025 22:18:44 +0300 Subject: [PATCH] Refine menu info+search disable buttons (#17889) --- intl/msg_hash_us.h | 4 ++-- menu/cbs/menu_cbs_info.c | 3 +++ menu/menu_driver.c | 14 ++++---------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 7d766fc49d..23af5c5e6b 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -3762,7 +3762,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_DISABLE_INFO_BUTTON, - "If enabled Info button presses will be ignored." + "If enabled Info function will be disabled." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_SEARCH_BUTTON, @@ -3770,7 +3770,7 @@ MSG_HASH( ) MSG_HASH( MENU_ENUM_SUBLABEL_INPUT_DISABLE_SEARCH_BUTTON, - "If enabled Search button presses will be ignored." + "If enabled Search function will be disabled." ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_DISABLE_LEFT_ANALOG_IN_MENU, diff --git a/menu/cbs/menu_cbs_info.c b/menu/cbs/menu_cbs_info.c index 8a84539f96..32575559f1 100644 --- a/menu/cbs/menu_cbs_info.c +++ b/menu/cbs/menu_cbs_info.c @@ -42,6 +42,9 @@ static int action_info_default(unsigned type, const char *label) bool audio_enable_menu_notice = settings->bools.audio_enable_menu_notice; #endif + if (settings->bools.menu_disable_info_button) + goto error; + menu_displaylist_info_init(&info); info.list = menu_stack; diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 7a2c823277..59c4820ee6 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -5629,19 +5629,13 @@ unsigned menu_event( else if (BIT256_GET_PTR(p_trigger_input, menu_cancel_btn)) ret = MENU_ACTION_CANCEL; else if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_X)) - { - if (!settings->bools.menu_disable_search_button) - ret = MENU_ACTION_SEARCH; - } + ret = MENU_ACTION_SEARCH; else if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_Y)) ret = MENU_ACTION_SCAN; else if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_START)) ret = MENU_ACTION_START; else if (BIT256_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_SELECT)) - { - if (!settings->bools.menu_disable_info_button) - ret = MENU_ACTION_INFO; - } + ret = MENU_ACTION_INFO; else if (BIT256_GET_PTR(p_trigger_input, RARCH_MENU_TOGGLE)) ret = MENU_ACTION_TOGGLE; @@ -7911,8 +7905,8 @@ bool menu_driver_iterate( bool menu_input_dialog_start_search(void) { input_driver_state_t *input_st = input_state_get_ptr(); -#ifdef HAVE_ACCESSIBILITY settings_t *settings = config_get_ptr(); +#ifdef HAVE_ACCESSIBILITY bool accessibility_enable = settings->bools.accessibility_enable; unsigned accessibility_narrator_speech_speed = settings->uints.accessibility_narrator_speech_speed; access_state_t *access_st = access_state_get_ptr(); @@ -7920,7 +7914,7 @@ bool menu_input_dialog_start_search(void) struct menu_state *menu_st = &menu_driver_state; menu_handle_t *menu = menu_st->driver_data; - if (!menu) + if (!menu || settings->bools.menu_disable_search_button) return false; #ifdef HAVE_MIST