(Achievements) Push empty entry if no achievements found

This commit is contained in:
twinaphex 2016-07-10 15:28:54 +02:00
parent db74b7cbbc
commit c9f2ad1b5e
3 changed files with 25 additions and 0 deletions

View File

@ -2191,6 +2191,7 @@ void cheevos_populate_menu(void *data)
{
#ifdef HAVE_MENU
unsigned i;
unsigned items_found = 0;
const cheevo_t *end = NULL;
cheevo_t *cheevo = NULL;
settings_t *settings = config_get_ptr();
@ -2202,9 +2203,12 @@ void cheevos_populate_menu(void *data)
for (i = 0; cheevo < end; i++, cheevo++)
{
if (!cheevo->active)
{
menu_entries_add_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
if (settings->cheevos.test_unofficial)
@ -2228,9 +2232,12 @@ void cheevos_populate_menu(void *data)
for (i = 0; cheevo < end; i++, cheevo++)
{
if (cheevo->active)
{
menu_entries_add_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
if (settings->cheevos.test_unofficial)
@ -2242,11 +2249,23 @@ void cheevos_populate_menu(void *data)
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
{
if (cheevo->active)
{
menu_entries_add_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
}
if (items_found == 0)
{
menu_entries_add_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ACHIEVEMENTS_TO_DISPLAY),
msg_hash_to_str(MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY),
MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY,
FILE_TYPE_NONE, 0, 0);
}
#endif
}

View File

@ -1265,6 +1265,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
return "no_performance_counters";
case MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY:
return "no_entries_to_display";
case MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY:
return "no_achievements_to_display";
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ACHIEVEMENTS:
return "cheevos_unlocked_achievements";
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ACHIEVEMENTS:
@ -2551,6 +2553,8 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
return "Custom Viewport Height";
case MENU_ENUM_LABEL_VALUE_NO_ENTRIES_TO_DISPLAY:
return "No entries to display.";
case MENU_ENUM_LABEL_VALUE_NO_ACHIEVEMENTS_TO_DISPLAY:
return "No achievements to display.";
case MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ACHIEVEMENTS:
return "Unlocked Achievements:";
case MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ACHIEVEMENTS:

View File

@ -579,6 +579,8 @@ enum msg_hash_enums
MENU_ENUM_LABEL_MENU_THROTTLE_FRAMERATE,
MENU_ENUM_LABEL_NO_ACHIEVEMENTS_TO_DISPLAY,
MENU_ENUM_LABEL_VALUE_NO_ACHIEVEMENTS_TO_DISPLAY,
MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY,
MENU_ENUM_LABEL_VALUE_NO_ENTRIES_TO_DISPLAY,