canvi de pc

This commit is contained in:
2025-03-02 08:09:15 +01:00
parent cd96be80f9
commit 193dac708f
3 changed files with 74 additions and 38 deletions

View File

@@ -77,18 +77,18 @@ int Cheevos::find(int id)
// Desbloquea un logro
void Cheevos::unlock(int id)
{
const int index = find(id);
const int INDEX = find(id);
// Si el índice es inválido, el logro no es válido, ya está completado o el sistema de logros no está habilitado, no hacemos nada
if (index == -1 || !cheevos_list_.at(index).obtainable || cheevos_list_.at(index).completed || !enabled_)
if (INDEX == -1 || !cheevos_list_.at(INDEX).obtainable || cheevos_list_.at(INDEX).completed || !enabled_)
{
return;
}
// Marcar el logro como completado
cheevos_list_.at(index).completed = true;
cheevos_list_.at(INDEX).completed = true;
// Mostrar notificación en la pantalla
Notifier::get()->show({"ACHIEVEMENT UNLOCKED!", cheevos_list_.at(index).caption}, NotificationText::LEFT, cheevos_list_.at(index).icon);
Notifier::get()->show({"ACHIEVEMENT UNLOCKED!", cheevos_list_.at(INDEX).caption}, NotificationText::LEFT, cheevos_list_.at(INDEX).icon);
// Guardar el estado de los logros
saveToFile();
}