Achievements: Consider all-hidden-leaderboards as no leaderboards
Stops the menu option being available and showing 0 leaderboards.
This commit is contained in:
parent
b4ae19411b
commit
54c42f9c27
|
@ -596,7 +596,7 @@ RC_EXPORT void RC_CCONV rc_client_destroy_leaderboard_list(rc_client_leaderboard
|
|||
/**
|
||||
* Returns non-zero if the current game has any leaderboards.
|
||||
*/
|
||||
RC_EXPORT int RC_CCONV rc_client_has_leaderboards(rc_client_t* client);
|
||||
RC_EXPORT int RC_CCONV rc_client_has_leaderboards(rc_client_t* client, int include_hidden);
|
||||
|
||||
typedef struct rc_client_leaderboard_entry_t {
|
||||
const char* user;
|
||||
|
|
|
@ -4465,10 +4465,10 @@ void rc_client_destroy_leaderboard_list(rc_client_leaderboard_list_t* list)
|
|||
free(list);
|
||||
}
|
||||
|
||||
int rc_client_has_leaderboards(rc_client_t* client)
|
||||
int rc_client_has_leaderboards(rc_client_t* client, int include_hidden)
|
||||
{
|
||||
rc_client_subset_info_t* subset;
|
||||
int result;
|
||||
int i, result;
|
||||
|
||||
if (!client)
|
||||
return 0;
|
||||
|
@ -4491,8 +4491,20 @@ int rc_client_has_leaderboards(rc_client_t* client)
|
|||
continue;
|
||||
|
||||
if (subset->public_.num_leaderboards > 0) {
|
||||
result = 1;
|
||||
break;
|
||||
if (!include_hidden) {
|
||||
for (i = 0; i < subset->public_.num_leaderboards; i++) {
|
||||
if (subset->leaderboards[i].hidden)
|
||||
continue;
|
||||
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
if (result)
|
||||
break;
|
||||
} else {
|
||||
result = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -515,7 +515,7 @@ void Achievements::UpdateGlyphRanges()
|
|||
}
|
||||
}
|
||||
|
||||
if (rc_client_has_leaderboards(s_state.client))
|
||||
if (rc_client_has_leaderboards(s_state.client, false))
|
||||
{
|
||||
rc_client_leaderboard_list_t* const leaderboards =
|
||||
rc_client_create_leaderboard_list(s_state.client, RC_CLIENT_LEADERBOARD_LIST_GROUPING_NONE);
|
||||
|
@ -1304,7 +1304,7 @@ void Achievements::ClientLoadGameCallback(int result, const char* error_message,
|
|||
}
|
||||
|
||||
const bool has_achievements = rc_client_has_achievements(client);
|
||||
const bool has_leaderboards = rc_client_has_leaderboards(client);
|
||||
const bool has_leaderboards = rc_client_has_leaderboards(client, false);
|
||||
|
||||
// Only display summary if the game title has changed across discs.
|
||||
const bool display_summary = (s_state.game_id != info->id || s_state.game_title != info->title);
|
||||
|
@ -2057,7 +2057,8 @@ bool Achievements::IsLoggedInOrLoggingIn()
|
|||
|
||||
bool Achievements::CanEnableHardcoreMode()
|
||||
{
|
||||
return (s_state.load_game_request || s_state.has_achievements || s_state.has_leaderboards);
|
||||
// have to re-query leaderboards because hidden should still trip HC
|
||||
return (s_state.load_game_request || s_state.has_achievements || rc_client_has_leaderboards(s_state.client, true));
|
||||
}
|
||||
|
||||
bool Achievements::Login(const char* username, const char* password, Error* error)
|
||||
|
|
Loading…
Reference in New Issue