mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-19 17:12:10 +00:00
Add action select callback
This commit is contained in:
parent
b317c1a8fb
commit
9122576870
@ -616,8 +616,8 @@ static int menu_common_iterate(unsigned action)
|
||||
ret = cbs->action_toggle(type_offset, label_offset, action);
|
||||
break;
|
||||
case MENU_ACTION_SELECT:
|
||||
menu_list_push_stack(driver.menu->menu_list, "", "info_screen",
|
||||
0, driver.menu->selection_ptr);
|
||||
if (cbs && cbs->action_select)
|
||||
ret = cbs->action_select(type_offset, label_offset, action);
|
||||
break;
|
||||
|
||||
case MENU_ACTION_REFRESH:
|
||||
|
@ -150,6 +150,7 @@ typedef struct menu_file_list_cbs
|
||||
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
||||
size_t idx);
|
||||
int (*action_start)(unsigned type, const char *label, unsigned action);
|
||||
int (*action_select)(unsigned type, const char *label, unsigned action);
|
||||
int (*action_content_list_switch)(void *data, void *userdata, const char
|
||||
*path, const char *label, unsigned type);
|
||||
int (*action_toggle)(unsigned type, const char *label, unsigned action);
|
||||
|
@ -2723,12 +2723,29 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_select_default(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
menu_list_push_stack(driver.menu->menu_list, "", "info_screen",
|
||||
0, driver.menu->selection_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_start_lookup_setting(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
return menu_action_setting_set(type, label, MENU_ACTION_START);
|
||||
}
|
||||
|
||||
static void menu_entries_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
if (!cbs)
|
||||
return;
|
||||
|
||||
cbs->action_select = action_select_default;
|
||||
}
|
||||
|
||||
static void menu_entries_cbs_init_bind_start(menu_file_list_cbs_t *cbs,
|
||||
const char *path, const char *label, unsigned type, size_t idx)
|
||||
{
|
||||
@ -3067,6 +3084,7 @@ void menu_entries_cbs_init(void *data,
|
||||
menu_entries_cbs_init_bind_ok(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_cancel(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_start(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_select(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_content_list_switch(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_up_or_down(cbs, path, label, type, idx);
|
||||
menu_entries_cbs_init_bind_toggle(cbs, path, label, type, idx);
|
||||
|
Loading…
x
Reference in New Issue
Block a user