From 1dd57f6e86601482a2e6f629cc6cc97f2b419c17 Mon Sep 17 00:00:00 2001 From: sergiobenrocha2 Date: Sun, 3 Jan 2016 16:40:37 -0200 Subject: [PATCH] Let's show rumble and analog support info only if the game supports it. --- menu/menu_displaylist.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 14a0a304d8..fcf204743c 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1400,24 +1400,21 @@ static int menu_displaylist_parse_database_entry(menu_displaylist_info_t *info) goto error; } - snprintf(tmp, sizeof(tmp), - "%s : %s", - "Analog supported", - (db_info_entry->analog_supported == 1) ? menu_hash_to_str(MENU_VALUE_TRUE) : - (db_info_entry->analog_supported == -1) ? menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE) : - menu_hash_to_str(MENU_VALUE_FALSE)); - menu_entries_push(info->list, tmp, - menu_hash_to_str(MENU_LABEL_RDB_ENTRY_ANALOG), - 0, 0, 0); - snprintf(tmp, sizeof(tmp), - "%s : %s", - "Rumble supported", - (db_info_entry->rumble_supported == 1) ? menu_hash_to_str(MENU_VALUE_TRUE) : - (db_info_entry->rumble_supported == -1) ? menu_hash_to_str(MENU_VALUE_NOT_AVAILABLE) : - menu_hash_to_str(MENU_VALUE_FALSE)); - menu_entries_push(info->list, tmp, - menu_hash_to_str(MENU_LABEL_RDB_ENTRY_RUMBLE), - 0, 0, 0); + if (db_info_entry->analog_supported == 1) + { + if (create_string_list_rdb_entry_string("Analog supported", + menu_hash_to_str(MENU_LABEL_RDB_ENTRY_ANALOG), + menu_hash_to_str(MENU_VALUE_TRUE), info->path, info->list) == -1) + goto error; + } + + if (db_info_entry->rumble_supported == 1) + { + if (create_string_list_rdb_entry_string("Rumble supported", + menu_hash_to_str(MENU_LABEL_RDB_ENTRY_RUMBLE), + menu_hash_to_str(MENU_VALUE_TRUE), info->path, info->list) == -1) + goto error; + } if (!show_advanced_settings) continue;