From 12e6a443c7769710f2c62df1dc28c88b9d9848b3 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 1 Jun 2015 07:38:59 +0200 Subject: [PATCH] Create MENU_ACTION_SELECT --- menu/menu_entry.c | 31 +++++-------------------------- menu/menu_input.h | 1 + 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/menu/menu_entry.c b/menu/menu_entry.c index 350c12e7dc..a3fd51d670 100644 --- a/menu/menu_entry.c +++ b/menu/menu_entry.c @@ -391,39 +391,14 @@ int menu_entry_get_current_id(bool use_representation) // cores and updating the currently displayed menu int menu_entry_select(uint32_t i) { - int ret = 0; menu_entry_t entry; - enum menu_action action = MENU_ACTION_NOOP; - menu_file_list_cbs_t *cbs = NULL; - menu_navigation_t *nav = menu_navigation_get_ptr(); menu_list_t *menu_list = menu_list_get_ptr(); rarch_setting_t *setting = menu_setting_find( menu_list->selection_buf->list[i].label); menu_entry_get(&entry, i, NULL, false); - cbs = menu_list_get_actiondata_at_offset(menu_list->selection_buf, i); - - if (setting_is_of_path_type(setting)) - return 0; - - nav->selection_ptr = i; - if ((cbs && cbs->action_ok) || setting_is_of_general_type(setting)) - action = MENU_ACTION_OK; - else - { - if (cbs && cbs->action_start) - action = MENU_ACTION_START; - if (cbs && cbs->action_right) - action = MENU_ACTION_RIGHT; - } - - if (action != MENU_ACTION_NOOP) - ret = menu_entry_action(&entry, i, action); - - rarch_main_data_iterate(); - - return ret; + return menu_entry_action(&entry, i, MENU_ACTION_SELECT); } int menu_entry_iterate(unsigned action) @@ -498,6 +473,10 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action) if (cbs && cbs->action_info) ret = cbs->action_info(entry->type, entry->label); break; + case MENU_ACTION_SELECT: + if (cbs && cbs->action_select) + ret = cbs->action_select(entry->path, entry->label, entry->type, i); + break; case MENU_ACTION_REFRESH: if (cbs && cbs->action_refresh) diff --git a/menu/menu_input.h b/menu/menu_input.h index 2eedc6efb7..59bde333ca 100644 --- a/menu/menu_input.h +++ b/menu/menu_input.h @@ -36,6 +36,7 @@ typedef enum menu_action MENU_ACTION_CANCEL, MENU_ACTION_REFRESH, MENU_ACTION_INFO, + MENU_ACTION_SELECT, MENU_ACTION_START, MENU_ACTION_MESSAGE, MENU_ACTION_SCROLL_DOWN,