[subsystem] allow loading from history

This commit is contained in:
radius 2019-04-11 18:18:37 -05:00
parent 230c64ba4b
commit 71bfd98012

View File

@ -1715,9 +1715,17 @@ static int action_ok_playlist_entry_collection(const char *path,
playlist_t *tmp_playlist = NULL;
menu_handle_t *menu = NULL;
const char *subsystem_ident = NULL;
const struct string_list
*subsystem_rom_list = NULL;
unsigned i = 0;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return menu_cbs_exit();
new_core_path[0] = '\0';
tmp_playlist = playlist_get_cached();
@ -1735,7 +1743,32 @@ static int action_ok_playlist_entry_collection(const char *path,
selection_ptr = entry_idx;
playlist_get_index(playlist, selection_ptr,
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL, NULL, NULL);
&entry_path, &entry_label, &core_path, &core_name, NULL, NULL, &subsystem_ident, &subsystem_rom_list);
/* Subsystem codepath */
if (!string_is_empty(subsystem_ident) && subsystem_rom_list)
{
content_ctx_info_t content_info = {0};
task_push_load_new_core(core_path, NULL,
&content_info, CORE_TYPE_PLAIN, NULL, NULL);
content_clear_subsystem();
if (!content_set_subsystem_by_name(subsystem_ident))
{
RARCH_LOG("[playlist] subsystem not found in implementation\n");
/* TODO: Add OSD message telling users that content can't be loaded */
return 0;
}
for (i = 0; i < subsystem_rom_list->size; i++)
content_add_subsystem(subsystem_rom_list->elems[i].data);
task_push_load_subsystem_with_core_from_menu(
NULL, &content_info,
CORE_TYPE_PLAIN, NULL, NULL);
/* TODO: update playlist entry? move to first position I guess? */
return 1;
}
/* Is the core path / name of the playlist entry not yet filled in? */
if ( string_is_equal(core_path, file_path_str(FILE_PATH_DETECT))