Skip to content

Commit

Permalink
Merge pull request libretro#5747 from meleu/patch-9
Browse files Browse the repository at this point in the history
cheevos: do not show "0 of 0 cheevos unlocked" msg
  • Loading branch information
inactive123 authored Nov 23, 2017
2 parents 5517e6b + 4318a43 commit 3c99ccb
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2830,25 +2830,31 @@ static int cheevos_iterate(coro_t* coro)

if(CHEEVOS_VAR_SETTINGS->bools.cheevos_verbose_enable)
{
const cheevo_t* cheevo = cheevos_locals.core.cheevos;
const cheevo_t* end = cheevo + cheevos_locals.core.count;
int number_of_unlocked = cheevos_locals.core.count;
int mode;
char msg[256];

if(CHEEVOS_VAR_SETTINGS->bools.cheevos_hardcore_mode_enable)
mode = CHEEVOS_ACTIVE_HARDCORE;
else
mode = CHEEVOS_ACTIVE_SOFTCORE;
if(cheevos_locals.core.count > 0)
{
const cheevo_t* cheevo = cheevos_locals.core.cheevos;
const cheevo_t* end = cheevo + cheevos_locals.core.count;
int number_of_unlocked = cheevos_locals.core.count;
int mode;
char msg[256];

if(CHEEVOS_VAR_SETTINGS->bools.cheevos_hardcore_mode_enable)
mode = CHEEVOS_ACTIVE_HARDCORE;
else
mode = CHEEVOS_ACTIVE_SOFTCORE;

for(; cheevo < end; cheevo++)
if(cheevo->active & mode)
number_of_unlocked--;
for(; cheevo < end; cheevo++)
if(cheevo->active & mode)
number_of_unlocked--;

snprintf(msg, sizeof(msg), "You have %d of %d achievements unlocked.",
number_of_unlocked, cheevos_locals.core.count);
msg[sizeof(msg) - 1] = 0;
runloop_msg_queue_push(msg, 0, 6 * 60, false);
}
else
runloop_msg_queue_push("This game has no achievements.", 0, 5 * 60, false);

snprintf(msg, sizeof(msg), "You have %d of %d achievements unlocked.",
number_of_unlocked, cheevos_locals.core.count);
msg[sizeof(msg) - 1] = 0;
runloop_msg_queue_push(msg, 0, 6 * 60, false);
}

CORO_STOP();
Expand Down

0 comments on commit 3c99ccb

Please sign in to comment.