From d42f01ad35505ec9273dbcbdfff8266765e04165 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 4 Jul 2015 17:20:49 +0200 Subject: [PATCH] If playlist directory is not set, make it possible in XMB mode to still escape to the left and/or right when there are no playlist entries found. --- menu/cbs/menu_cbs_left.c | 13 +++++++++++-- menu/cbs/menu_cbs_right.c | 8 ++++++++ menu/intl/menu_hash_us.c | 2 ++ menu/menu_displaylist.c | 7 ++++--- menu/menu_hash.h | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index 741f1c6c08..72b1deaed1 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -135,6 +135,7 @@ static int action_left_scroll(unsigned type, const char *label, static int action_left_mainmenu(unsigned type, const char *label, bool wraparound) { + RARCH_LOG("Gets here.\n"); menu_file_list_cbs_t *cbs = NULL; unsigned push_list = 0; menu_list_t *menu_list = menu_list_get_ptr(); @@ -341,7 +342,7 @@ static int bind_left_generic(unsigned type, const char *label, } static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs, - const char *label, uint32_t label_hash, const char *elem0) + const char *label, uint32_t label_hash, uint32_t menu_label_hash, const char *elem0) { unsigned i; rarch_setting_t *setting = menu_setting_find(label); @@ -402,6 +403,14 @@ static int menu_cbs_init_bind_left_compare_label(menu_file_list_cbs_t *cbs, case MENU_LABEL_SCREEN_RESOLUTION: cbs->action_left = action_left_video_resolution; break; + case MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE: + switch (menu_label_hash) + { + case MENU_VALUE_HORIZONTAL_MENU: + case MENU_VALUE_MAIN_MENU: + cbs->action_left = action_left_mainmenu; + break; + } default: return -1; } @@ -492,7 +501,7 @@ int menu_cbs_init_bind_left(menu_file_list_cbs_t *cbs, cbs->action_left = bind_left_generic; - if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, elem0) == 0) + if (menu_cbs_init_bind_left_compare_label(cbs, label, label_hash, menu_label_hash, elem0) == 0) return 0; if (menu_cbs_init_bind_left_compare_type(cbs, type, label_hash, menu_label_hash) == 0) diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index 2224a5a7cf..6c591b2b70 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -474,6 +474,14 @@ static int menu_cbs_init_bind_right_compare_label(menu_file_list_cbs_t *cbs, case MENU_LABEL_SCREEN_RESOLUTION: cbs->action_right = action_right_video_resolution; break; + case MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE: + switch (menu_label_hash) + { + case MENU_VALUE_HORIZONTAL_MENU: + case MENU_VALUE_MAIN_MENU: + cbs->action_right = action_right_mainmenu; + break; + } default: return -1; } diff --git a/menu/intl/menu_hash_us.c b/menu/intl/menu_hash_us.c index bf00fc9c8e..b863d6b466 100644 --- a/menu/intl/menu_hash_us.c +++ b/menu/intl/menu_hash_us.c @@ -26,6 +26,8 @@ static const char *menu_hash_to_str_us_label(uint32_t hash) { switch (hash) { + case MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE: + return "no_playlist_entries_available"; case MENU_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST: return "downloaded_file_detect_core_list"; case MENU_LABEL_UPDATE_CORE_INFO_FILES: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index bfe1d2f0d1..a11e50c7b6 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -739,8 +739,9 @@ static int menu_displaylist_parse_playlist(menu_displaylist_info_t *info, if (list_size <= 0) { menu_list_push(info->list, - menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), "", - MENU_SETTINGS_CORE_OPTION_NONE, 0, 0); + menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), + menu_hash_to_str(MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), + 0, 0, 0); return 0; } @@ -1289,7 +1290,7 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info) if (db_info->count < 1) menu_list_push(info->list, menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE), - "", + menu_hash_to_str(MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE), 0, 0, 0); content_playlist_free(playlist); diff --git a/menu/menu_hash.h b/menu/menu_hash.h index 45626de3ef..f332475c83 100644 --- a/menu/menu_hash.h +++ b/menu/menu_hash.h @@ -168,7 +168,6 @@ extern "C" { #define MENU_LABEL_VALUE_NO_SHADER_PARAMETERS 0x8ccc809bU #define MENU_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE 0x2a11fe80U #define MENU_LABEL_VALUE_NO_CORES_AVAILABLE 0xe16bfd0dU -#define MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE 0xea82695dU #define MENU_LABEL_SAVE_STATE 0x3a4849b5U #define MENU_LABEL_VALUE_LOAD_STATE 0xd23ba706U #define MENU_LABEL_VALUE_SAVE_STATE 0x3e182415U @@ -441,6 +440,7 @@ extern "C" { #define MENU_LABEL_TURBO 0x107434f1U +#define MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE 0x8888c5acU #define MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE 0xea82695dU #define MENU_LABEL_VALUE_RDB_ENTRY_START_CONTENT 0x2cf73cceU #define MENU_LABEL_RDB_ENTRY_ANALOG 0x9081c2ffU