Merge pull request #2011 from lakkatv/xmb

(Menu) Integrate the quick menu in the playlists. Allow launching con…
This commit is contained in:
Twinaphex 2015-07-23 19:52:29 +02:00
commit 7be8cc5fce
8 changed files with 105 additions and 38 deletions

View File

@ -69,6 +69,11 @@ static int deferred_push_rdb_entry_detail(menu_displaylist_info_t *info)
return ret;
}
static int deferred_push_rpl_entry_actions(menu_displaylist_info_t *info)
{
return menu_displaylist_push_list(info, DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS);
}
static int deferred_push_core_list_deferred(menu_displaylist_info_t *info)
{
return menu_displaylist_push_list(info, DISPLAYLIST_CORES_SUPPORTED);
@ -666,6 +671,8 @@ static int menu_cbs_init_bind_deferred_push_compare_label(menu_file_list_cbs_t *
{
if (strstr(label, menu_hash_to_str(MENU_LABEL_DEFERRED_RDB_ENTRY_DETAIL)))
cbs->action_deferred_push = deferred_push_rdb_entry_detail;
else if (strstr(label, menu_hash_to_str(MENU_LABEL_DEFERRED_RPL_ENTRY_ACTIONS)))
cbs->action_deferred_push = deferred_push_rpl_entry_actions;
else
{
switch (label_hash)

View File

@ -449,6 +449,7 @@ static int menu_cbs_init_bind_left_compare_type(menu_file_list_cbs_t *cbs,
case MENU_FILE_CORE:
case MENU_FILE_RDB:
case MENU_FILE_RDB_ENTRY:
case MENU_FILE_RPL_ENTRY:
case MENU_FILE_CURSOR:
case MENU_FILE_SHADER:
case MENU_FILE_SHADER_PRESET:

View File

@ -32,7 +32,7 @@
/* FIXME - Global variables, refactor */
char detect_content_path[PATH_MAX_LENGTH];
unsigned rdb_entry_start_game_selection_ptr;
unsigned rdb_entry_start_game_selection_ptr, rpl_entry_selection_ptr;
size_t hack_shader_pass = 0;
#ifdef HAVE_NETWORKING
char core_updater_path[PATH_MAX_LENGTH];
@ -173,6 +173,28 @@ static int action_ok_file_load_detect_core(const char *path,
return -1;
}
static int action_ok_rpl_entry(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
menu_handle_t *menu = menu_driver_get_ptr();
char tmp[PATH_MAX_LENGTH] = {0};
menu_displaylist_info_t info = {0};
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu_list)
return -1;
strlcpy(menu->deferred_path, label, sizeof(menu->deferred_path));
info.list = menu_list->menu_stack;
info.type = 0;
info.directory_ptr = idx;
rpl_entry_selection_ptr = idx;
strlcpy(info.label, menu_hash_to_str(MENU_LABEL_DEFERRED_RPL_ENTRY_ACTIONS), sizeof(info.label));
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
}
static int action_ok_playlist_entry(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
@ -183,6 +205,7 @@ static int action_ok_playlist_entry(const char *path,
const char *core_name = NULL;
size_t selection_ptr = 0;
content_playlist_t *playlist = g_defaults.history;
bool is_history = true;
menu_handle_t *menu = menu_driver_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
uint32_t hash_label = menu_hash_calculate(label);
@ -203,6 +226,7 @@ static int action_ok_playlist_entry(const char *path,
}
playlist = menu->playlist;
is_history = false;
break;
}
@ -234,18 +258,21 @@ static int action_ok_playlist_entry(const char *path,
rarch_playlist_load_content(playlist, selection_ptr);
switch (hash_label)
if (is_history)
{
case MENU_LABEL_COLLECTION:
case MENU_LABEL_RDB_ENTRY_START_CONTENT:
menu_list_pop_stack(menu_list);
break;
default:
menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
break;
}
switch (hash_label)
{
case MENU_LABEL_COLLECTION:
case MENU_LABEL_RDB_ENTRY_START_CONTENT:
menu_list_pop_stack(menu_list);
break;
default:
menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
break;
}
menu_common_push_content_settings();
menu_common_push_content_settings();
}
return -1;
}
@ -2278,6 +2305,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
case MENU_FILE_PLAYLIST_ENTRY:
cbs->action_ok = action_ok_playlist_entry;
break;
case MENU_FILE_RPL_ENTRY:
cbs->action_ok = action_ok_rpl_entry;
break;
case MENU_FILE_PLAYLIST_COLLECTION:
cbs->action_ok = action_ok_playlist_collection;
break;

View File

@ -372,6 +372,7 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
case MENU_FILE_CORE:
case MENU_FILE_RDB:
case MENU_FILE_RDB_ENTRY:
case MENU_FILE_RPL_ENTRY:
case MENU_FILE_CURSOR:
case MENU_FILE_SHADER:
case MENU_FILE_SHADER_PRESET:

View File

@ -1166,8 +1166,7 @@ static GRuint xmb_icon_get_id(xmb_handle_t *xmb,
return xmb->textures.list[XMB_TEXTURE_FOLDER].id;
case MENU_FILE_PLAIN:
return xmb->textures.list[XMB_TEXTURE_FILE].id;
case MENU_FILE_PLAYLIST_ENTRY:
case MENU_FILE_RDB_ENTRY:
case MENU_FILE_RPL_ENTRY:
if (core_node)
return core_node->content_icon;
return xmb->textures.list[XMB_TEXTURE_FILE].id;
@ -1185,6 +1184,7 @@ static GRuint xmb_icon_get_id(xmb_handle_t *xmb,
return xmb->textures.list[XMB_TEXTURE_RDB].id;
case MENU_FILE_CURSOR:
return xmb->textures.list[XMB_TEXTURE_CURSOR].id;
case MENU_FILE_PLAYLIST_ENTRY:
case MENU_SETTING_ACTION_RUN:
return xmb->textures.list[XMB_TEXTURE_RUN].id;
case MENU_SETTING_ACTION_CLOSE:
@ -1193,6 +1193,7 @@ static GRuint xmb_icon_get_id(xmb_handle_t *xmb,
return xmb->textures.list[XMB_TEXTURE_SAVESTATE].id;
case MENU_SETTING_ACTION_LOADSTATE:
return xmb->textures.list[XMB_TEXTURE_LOADSTATE].id;
case MENU_FILE_RDB_ENTRY:
case MENU_SETTING_ACTION_CORE_INFORMATION:
return xmb->textures.list[XMB_TEXTURE_CORE_INFO].id;
case MENU_SETTING_ACTION_CORE_OPTIONS:

View File

@ -89,6 +89,7 @@ typedef enum
MENU_FILE_DOWNLOAD_CORE_INFO,
MENU_FILE_RDB,
MENU_FILE_RDB_ENTRY,
MENU_FILE_RPL_ENTRY,
MENU_FILE_CURSOR,
MENU_FILE_RECORD_CONFIG,
MENU_FILE_PLAYLIST_COLLECTION,

View File

@ -45,6 +45,7 @@
#ifdef HAVE_NETWORKING
extern char *core_buf;
extern size_t core_len;
extern unsigned rpl_entry_selection_ptr;
static void print_buf_lines(file_list_t *list, char *buf, int buf_size,
unsigned type)
@ -830,21 +831,12 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info,
}
}
if (!is_history && core_detected && db_name && db_name[0] != '\0')
{
char db_path[PATH_MAX_LENGTH] = {0};
fill_pathname_join(db_path, settings->content_database,
db_name, sizeof(db_path));
path_remove_extension(db_path);
strlcat(db_path, ".rdb", sizeof(db_path));
menu_list_push(info->list, label,
db_path, MENU_FILE_RDB_ENTRY, 0, i);
}
else
if (is_history)
menu_list_push(info->list, fill_buf, path_playlist,
MENU_FILE_PLAYLIST_ENTRY, 0, i);
else
menu_list_push(info->list, label,
path, MENU_FILE_RPL_ENTRY, 0, i);
}
return 0;
@ -1095,18 +1087,6 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info)
continue;
rdb_entry_start_game_selection_ptr = j;
core_name_hash = menu_hash_calculate(playlist->entries[j].core_name);
core_path_hash = menu_hash_calculate(playlist->entries[j].core_path);
if (
(core_name_hash != MENU_VALUE_DETECT) &&
(core_path_hash != MENU_VALUE_DETECT)
)
menu_list_push(info->list,
menu_hash_to_str(MENU_LABEL_VALUE_RDB_ENTRY_START_CONTENT),
menu_hash_to_str(MENU_LABEL_RDB_ENTRY_START_CONTENT),
MENU_FILE_PLAYLIST_ENTRY, 0, 0);
}
}
@ -1658,6 +1638,46 @@ static int menu_displaylist_parse_load_content_settings(menu_displaylist_info_t
return 0;
}
static int menu_displaylist_parse_horizontal_content_actions(menu_displaylist_info_t *info)
{
menu_handle_t *menu = menu_driver_get_ptr();
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
unsigned idx = rpl_entry_selection_ptr;
const char *label = NULL;
const char *core_path = NULL;
const char *core_name = NULL;
const char *db_name = NULL;
if (!menu)
return -1;
if (global->main_is_init && (global->core_type != CORE_TYPE_DUMMY)
&& !strcmp(menu->deferred_path, global->fullpath))
menu_displaylist_parse_load_content_settings(info);
else
menu_list_push(info->list, "Run", "collection",
MENU_FILE_PLAYLIST_ENTRY, 0, idx);
content_playlist_get_index(menu->playlist, idx,
NULL, &label, &core_path, &core_name, NULL, &db_name);
if (db_name && db_name[0] != '\0')
{
char db_path[PATH_MAX_LENGTH] = {0};
fill_pathname_join(db_path, settings->content_database,
db_name, sizeof(db_path));
path_remove_extension(db_path);
strlcat(db_path, ".rdb", sizeof(db_path));
menu_list_push(info->list, label,
db_path, MENU_FILE_RDB_ENTRY, 0, idx);
}
return 0;
}
static int menu_displaylist_parse_information_list(menu_displaylist_info_t *info)
{
global_t *global = global_get_ptr();
@ -2223,6 +2243,11 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
need_push = true;
break;
case DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS:
menu_list_clear(info->list);
ret = menu_displaylist_parse_horizontal_content_actions(info);
need_refresh = true;
need_push = true;
break;
case DISPLAYLIST_CONTENT_SETTINGS:
menu_list_clear(info->list);
ret = menu_displaylist_parse_load_content_settings(info);

View File

@ -640,6 +640,7 @@ extern "C" {
#define MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_BBFC_RATING 0x0a8e67f0U
#define MENU_LABEL_DEFERRED_CURSOR_MANAGER_LIST_RDB_ENTRY_MAX_USERS 0xbfcba816U
#define MENU_LABEL_DEFERRED_RDB_ENTRY_DETAIL 0xc35416c0U
#define MENU_LABEL_DEFERRED_RPL_ENTRY_ACTIONS 0x358a7494U
#define MENU_LABEL_DEFERRED_CORE_LIST 0xf157d289U
#define MENU_LABEL_DEFERRED_CORE_UPDATER_LIST 0xc315f682U
#define MENU_LABEL_DISK_IMAGE_APPEND 0x5af7d709U