Merge pull request #5765 from libretro/revert-5763-single_list

Revert "use a single list for achievements"
This commit is contained in:
Twinaphex 2017-11-24 02:50:33 +01:00 committed by GitHub
commit 75f9351f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 98 additions and 130 deletions

View File

@ -2138,7 +2138,7 @@ void cheevos_reset_game(void)
cheevo->last = 1;
}
void cheevos_populate_menu(void *data)
void cheevos_populate_menu(void *data, bool hardcore)
{
#ifdef HAVE_MENU
unsigned i;
@ -2151,30 +2151,39 @@ void cheevos_populate_menu(void *data)
for (i = 0; cheevo < end; i++, cheevo++)
{
if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE))
if (!hardcore)
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_HARDCORE));
}
else if (!(cheevo->active & CHEEVOS_ACTIVE_SOFTCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE));
if (!(cheevo->active & CHEEVOS_ACTIVE_SOFTCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE));
if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
}
@ -2184,29 +2193,42 @@ void cheevos_populate_menu(void *data)
end = cheevos_locals.unofficial.cheevos
+ cheevos_locals.unofficial.count;
if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE))
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_HARDCORE));
}
else if (!(cheevo->active & CHEEVOS_ACTIVE_SOFTCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE));
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE));
if (!hardcore)
{
if (!(cheevo->active & CHEEVOS_ACTIVE_SOFTCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
else
{
if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE))
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
else
{
menu_entries_append_enum(info->list, cheevo->title,
cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY,
MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
items_found++;
}
}
}
}
@ -3135,63 +3157,6 @@ static int cheevos_iterate(coro_t* coro)
CORO_RET();
/**************************************************************************
<<<<<<< Updated upstream
=======
* Info Gets the achievements from Retro Achievements
* Inputs CHEEVOS_VAR_GAMEID
* Outputs CHEEVOS_VAR_JSON
*************************************************************************/
CORO_SUB(GET_BADGES)
badges_ctx = new_badges_ctx;
settings_t *settings = config_get_ptr();
if (!string_is_equal(settings->arrays.menu_driver, "xmb") ||
!settings->bools.cheevos_badges_enable)
CORO_RET();
CHEEVOS_VAR_CHEEVO_CURR = cheevos_locals.core.cheevos;
CHEEVOS_VAR_CHEEVO_END = cheevos_locals.core.cheevos + cheevos_locals.core.count;
for (; CHEEVOS_VAR_CHEEVO_CURR < CHEEVOS_VAR_CHEEVO_END ; CHEEVOS_VAR_CHEEVO_CURR++)
{
for (CHEEVOS_VAR_J = 0 ; CHEEVOS_VAR_J < 2; CHEEVOS_VAR_J++)
{
CHEEVOS_VAR_BADGE_PATH[0] = '\0';
fill_pathname_application_special(CHEEVOS_VAR_BADGE_BASE_PATH, sizeof(CHEEVOS_VAR_BADGE_BASE_PATH),
APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES);
if (!path_is_directory(CHEEVOS_VAR_BADGE_BASE_PATH))
path_mkdir(CHEEVOS_VAR_BADGE_BASE_PATH);
CORO_YIELD();
if (CHEEVOS_VAR_J == 0)
snprintf(CHEEVOS_VAR_BADGE_NAME, sizeof(CHEEVOS_VAR_BADGE_NAME), "%s.png", CHEEVOS_VAR_CHEEVO_CURR->badge);
else
snprintf(CHEEVOS_VAR_BADGE_NAME, sizeof(CHEEVOS_VAR_BADGE_NAME), "%s_lock.png", CHEEVOS_VAR_CHEEVO_CURR->badge);
fill_pathname_join(CHEEVOS_VAR_BADGE_PATH, CHEEVOS_VAR_BADGE_BASE_PATH, CHEEVOS_VAR_BADGE_NAME, sizeof(CHEEVOS_VAR_BADGE_PATH));
if (!badge_exists(CHEEVOS_VAR_BADGE_PATH))
{
snprintf(CHEEVOS_VAR_URL, sizeof(CHEEVOS_VAR_URL), "http://i.retroachievements.org/Badge/%s", CHEEVOS_VAR_BADGE_NAME);
CORO_GOSUB(HTTP_GET);
if (CHEEVOS_VAR_JSON != NULL)
{
if (filestream_write_file(CHEEVOS_VAR_BADGE_PATH, CHEEVOS_VAR_JSON, CHEEVOS_VAR_K))
RARCH_ERR("[CHEEVOS]: error writing badge %s\n", CHEEVOS_VAR_BADGE_PATH);
#ifdef CHEEVOS_LOG_BADGES
RARCH_LOG("[CHEEVOS]: downloaded badge %s\n", CHEEVOS_VAR_BADGE_PATH);
#endif
}
}
}
}
CORO_RET();
/**************************************************************************
>>>>>>> Stashed changes
* Info Logs in the user at Retro Achievements
*************************************************************************/
CORO_SUB(LOGIN)

View File

@ -117,7 +117,7 @@ bool cheevos_load(const void *data);
void cheevos_reset_game(void);
void cheevos_populate_menu(void *data);
void cheevos_populate_menu(void *data, bool hardcore);
bool cheevos_get_description(cheevos_ctx_desc_t *desc);

View File

@ -148,8 +148,6 @@ MSG_HASH(MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ACHIEVEMENTS,
"cheevos_unlocked_achievements")
MSG_HASH(MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY,
"cheevos_unlocked_entry")
MSG_HASH(MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE,
"cheevos_unlocked_entry_hardcore")
MSG_HASH(MENU_ENUM_LABEL_CHEEVOS_USERNAME,
"cheevos_username")
MSG_HASH(MENU_ENUM_LABEL_CHEEVOS_VERBOSE_ENABLE,

View File

@ -458,10 +458,6 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY,
"Unlocked"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY_HARDCORE,
"Hardcore"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CHEEVOS_VERBOSE_ENABLE,
"Achievements Verbose Mode"

View File

@ -78,6 +78,11 @@ static int deferred_push_achievement_list(menu_displaylist_info_t *info)
return deferred_push_dlist(info, DISPLAYLIST_ACHIEVEMENT_LIST);
}
static int deferred_push_achievement_list_hardcore(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_ACHIEVEMENT_LIST_HARDCORE);
}
static int deferred_push_rdb_collection(menu_displaylist_info_t *info)
{
return deferred_push_dlist(info, DISPLAYLIST_PLAYLIST_COLLECTION);
@ -1528,6 +1533,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_achievement_list);
break;
case MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_achievement_list_hardcore);
break;
case MENU_ENUM_LABEL_CORE_COUNTERS:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_counters);
break;
@ -1760,6 +1768,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_LABEL_ACHIEVEMENT_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_achievement_list);
break;
case MENU_LABEL_ACHIEVEMENT_LIST_HARDCORE:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_achievement_list_hardcore);
break;
case MENU_LABEL_CORE_COUNTERS:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_counters);
break;

View File

@ -94,21 +94,6 @@ static void menu_action_setting_disp_set_label_cheevos_unlocked_entry(
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY), len);
}
static void menu_action_setting_disp_set_label_cheevos_unlocked_entry_hardcore(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *entry_label,
const char *path,
char *s2, size_t len2)
{
*w = 19;
strlcpy(s2, path, len2);
strlcpy(s,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CHEEVOS_UNLOCKED_ENTRY_HARDCORE), len);
}
static void menu_action_setting_disp_set_label_remap_file_load(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -1991,10 +1976,6 @@ int menu_cbs_init_bind_get_string_representation(menu_file_list_cbs_t *cbs,
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheevos_unlocked_entry);
return 0;
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheevos_unlocked_entry_hardcore);
return 0;
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_cheevos_locked_entry);

View File

@ -1246,7 +1246,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_shared_context);
break;
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY:
case MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE:
case MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_cheevos_entry);
break;

View File

@ -189,6 +189,7 @@ default_fill_title_macro(action_get_title_collection, MENU_ENUM_LABE
default_title_copy_macro(action_get_title_help, MENU_ENUM_LABEL_VALUE_HELP_LIST)
default_title_copy_macro(action_get_title_input_settings, MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS)
default_title_copy_macro(action_get_title_cheevos_list, MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_LIST)
default_title_copy_macro(action_get_title_cheevos_list_hardcore, MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_LIST_HARDCORE)
default_title_copy_macro(action_get_title_video_shader_parameters,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS)
default_title_copy_macro(action_get_title_video_shader_preset_parameters,MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS)
@ -1017,6 +1018,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_LABEL_ACHIEVEMENT_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_title_cheevos_list);
break;
case MENU_LABEL_ACHIEVEMENT_LIST_HARDCORE:
BIND_ACTION_GET_TITLE(cbs, action_get_title_cheevos_list_hardcore);
break;
case MENU_LABEL_VIDEO_SHADER_PARAMETERS:
BIND_ACTION_GET_TITLE(cbs, action_get_title_video_shader_parameters);
break;

View File

@ -2954,6 +2954,11 @@ static int menu_displaylist_parse_load_content_settings(
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_LIST),
MENU_ENUM_LABEL_ACHIEVEMENT_LIST,
MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_LIST_HARDCORE),
msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE),
MENU_ENUM_LABEL_ACHIEVEMENT_LIST_HARDCORE,
MENU_SETTING_ACTION, 0, 0);
}
#endif
}
@ -4735,7 +4740,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
case DISPLAYLIST_ACHIEVEMENT_LIST:
#ifdef HAVE_CHEEVOS
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
cheevos_populate_menu(info);
cheevos_populate_menu(info, false);
info->need_push = true;
info->need_refresh = true;
#endif
break;
case DISPLAYLIST_ACHIEVEMENT_LIST_HARDCORE:
#ifdef HAVE_CHEEVOS
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
cheevos_populate_menu(info, true);
info->need_push = true;
info->need_refresh = true;
#endif

View File

@ -108,7 +108,8 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_NETWORK_INFO,
DISPLAYLIST_SYSTEM_INFO,
DISPLAYLIST_ACHIEVEMENT_LIST,
DISPLAYLIST_USER_BINDS_LIST,
DISPLAYLIST_ACHIEVEMENT_LIST_HARDCORE,
DISPLAYLIST_USER_BINDS_LIST,
DISPLAYLIST_ACCOUNTS_LIST,
DISPLAYLIST_DRIVER_SETTINGS_LIST,
DISPLAYLIST_VIDEO_SETTINGS_LIST,

View File

@ -463,7 +463,6 @@ enum msg_hash_enums
MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY,
MENU_LABEL(CHEEVOS_UNLOCKED_ENTRY),
MENU_LABEL(CHEEVOS_UNLOCKED_ENTRY_HARDCORE),
MENU_LABEL(CHEEVOS_LOCKED_ENTRY),
MENU_ENUM_LABEL_SHADER_PARAMETERS_ENTRY,
@ -1856,6 +1855,7 @@ enum msg_hash_enums
#define MENU_LABEL_FRONTEND_COUNTERS 0xe5696877U
#define MENU_LABEL_CORE_COUNTERS 0x64cc83e0U
#define MENU_LABEL_ACHIEVEMENT_LIST 0x7b90fc49U
#define MENU_LABEL_ACHIEVEMENT_LIST_HARDCORE 0x7c632930U
#define MENU_LABEL_CORE_INFORMATION 0xb638e0d3U
#define MENU_LABEL_CORE_OPTIONS 0xf65e60f9U
#define MENU_LABEL_SHADER_OPTIONS 0x1f7d2fc7U