diff --git a/source/global_inputs.cpp b/source/global_inputs.cpp index 100891d..0cec1bb 100644 --- a/source/global_inputs.cpp +++ b/source/global_inputs.cpp @@ -29,14 +29,21 @@ namespace globalInputs // Termina 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::options = code; } 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 } } diff --git a/source/utils.cpp b/source/utils.cpp index ac29902..bd1f055 100644 --- a/source/utils.cpp +++ b/source/utils.cpp @@ -213,4 +213,10 @@ double easeOutQuint(double t) double easeInOutSine(double t) { return -0.5 * (std::cos(M_PI * t) - 1); -} \ No newline at end of file +} + +// Comprueba si una vector contiene una cadena +bool stringInVector(const std::vector &vec, const std::string &str) +{ + return std::find(vec.begin(), vec.end(), str) != vec.end(); +} diff --git a/source/utils.h b/source/utils.h index cff6d95..801c3e4 100644 --- a/source/utils.h +++ b/source/utils.h @@ -282,6 +282,9 @@ double easeOutQuint(double t); // Función de suavizado double easeInOutSine(double t); +// Comprueba si una vector contiene una cadena +bool stringInVector(const std::vector &vec, const std::string &str); + // Colores extern const Color bg_color; extern const Color no_color;