Ja comprova la notificació d'eixir per diferenciarla de la resta

En ARCADE la notificació diferencia si vas a eixir o a apagar el sistema
This commit is contained in:
2024-10-15 20:40:45 +02:00
parent e0faa0890e
commit 53f5f3f8b0
3 changed files with 19 additions and 3 deletions

View File

@@ -29,14 +29,21 @@ namespace globalInputs
// Termina // Termina
void quit(section::Options code) void quit(section::Options code)
{ {
if (Notifier::get()->isActive()) const std::string exit_code = "QUIT";
auto code_found = stringInVector(Notifier::get()->getCodes(), exit_code);
if (code_found)
{ {
section::name = section::Name::QUIT; section::name = section::Name::QUIT;
section::options = code; section::options = code;
} }
else else
{ {
Notifier::get()->showText(lang::getText(94)); #ifdef ARCADE
const int index = code == section::Options::QUIT_NORMAL ? 94 : 116;
Notifier::get()->showText(lang::getText(index), std::string(), -1, exit_code);
#else
Notifier::get()->showText(lang::getText(94), std::string(), -1, exit_code);
#endif
} }
} }

View File

@@ -214,3 +214,9 @@ double easeInOutSine(double t)
{ {
return -0.5 * (std::cos(M_PI * t) - 1); return -0.5 * (std::cos(M_PI * t) - 1);
} }
// Comprueba si una vector contiene una cadena
bool stringInVector(const std::vector<std::string> &vec, const std::string &str)
{
return std::find(vec.begin(), vec.end(), str) != vec.end();
}

View File

@@ -282,6 +282,9 @@ double easeOutQuint(double t);
// Función de suavizado // Función de suavizado
double easeInOutSine(double t); double easeInOutSine(double t);
// Comprueba si una vector contiene una cadena
bool stringInVector(const std::vector<std::string> &vec, const std::string &str);
// Colores // Colores
extern const Color bg_color; extern const Color bg_color;
extern const Color no_color; extern const Color no_color;