mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Merge pull request #1710 from natinusala/master
Added an input/action callback in the menu_ctx_driver
This commit is contained in:
commit
f0506843c0
@ -674,4 +674,5 @@ menu_ctx_driver_t menu_ctx_glui = {
|
|||||||
NULL,
|
NULL,
|
||||||
glui_load_wallpaper,
|
glui_load_wallpaper,
|
||||||
"glui",
|
"glui",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -48,4 +48,5 @@ menu_ctx_driver_t menu_ctx_null = {
|
|||||||
NULL, // list_set_selection
|
NULL, // list_set_selection
|
||||||
NULL,
|
NULL,
|
||||||
"null",
|
"null",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -654,4 +654,5 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
"rgui",
|
"rgui",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -329,4 +329,5 @@ menu_ctx_driver_t menu_ctx_rmenu = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
"rmenu",
|
"rmenu",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -683,4 +683,5 @@ menu_ctx_driver_t menu_ctx_rmenu_xui = {
|
|||||||
rmenu_xui_list_set_selection,
|
rmenu_xui_list_set_selection,
|
||||||
NULL,
|
NULL,
|
||||||
"rmenu_xui",
|
"rmenu_xui",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -1936,4 +1936,5 @@ menu_ctx_driver_t menu_ctx_xmb = {
|
|||||||
NULL,
|
NULL,
|
||||||
xmb_load_wallpaper,
|
xmb_load_wallpaper,
|
||||||
"xmb",
|
"xmb",
|
||||||
|
NULL,
|
||||||
};
|
};
|
||||||
|
@ -254,6 +254,7 @@ typedef struct menu_ctx_driver
|
|||||||
void (*list_set_selection)(file_list_t *list);
|
void (*list_set_selection)(file_list_t *list);
|
||||||
bool (*load_background)(void *data);
|
bool (*load_background)(void *data);
|
||||||
const char *ident;
|
const char *ident;
|
||||||
|
bool (*perform_action)(void* data, unsigned action);
|
||||||
} menu_ctx_driver_t;
|
} menu_ctx_driver_t;
|
||||||
|
|
||||||
extern menu_ctx_driver_t menu_ctx_rmenu;
|
extern menu_ctx_driver_t menu_ctx_rmenu;
|
||||||
|
@ -940,6 +940,14 @@ void menu_input_post_iterate(int *ret, unsigned action)
|
|||||||
*ret |= menu_input_pointer_post_iterate(cbs, &entry, action);
|
*ret |= menu_input_pointer_post_iterate(cbs, &entry, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const menu_ctx_driver_t *menu_ctx_driver_get_ptr(void)
|
||||||
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
if (!driver || !driver->menu_ctx)
|
||||||
|
return NULL;
|
||||||
|
return driver->menu_ctx;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input)
|
unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input)
|
||||||
{
|
{
|
||||||
unsigned ret = 0;
|
unsigned ret = 0;
|
||||||
@ -1029,6 +1037,13 @@ unsigned menu_input_frame(retro_input_t input, retro_input_t trigger_input)
|
|||||||
|
|
||||||
if (settings->menu.pointer.enable)
|
if (settings->menu.pointer.enable)
|
||||||
menu_input_pointer(&ret);
|
menu_input_pointer(&ret);
|
||||||
|
|
||||||
return ret;
|
if (trigger_input && menu_ctx_driver_get_ptr()->perform_action && menu_ctx_driver_get_ptr()->perform_action(menu->userdata, ret))
|
||||||
|
{
|
||||||
|
return MENU_ACTION_NOOP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user