diff --git a/data/shapes/font/char_lparen.shp b/data/shapes/font/char_lparen.shp new file mode 100644 index 0000000..f99f143 --- /dev/null +++ b/data/shapes/font/char_lparen.shp @@ -0,0 +1,9 @@ +# char_lparen.shp - Símbol ( (parèntesi esquerre) +# Dimensions: 20×40 (blocky display) + +name: char_lparen +scale: 1.0 +center: 10, 20 + +# Arc cap a l'esquerra aproximat amb 4 trams rectes +polyline: 14,4 8,12 6,20 8,28 14,36 diff --git a/data/shapes/font/char_rparen.shp b/data/shapes/font/char_rparen.shp new file mode 100644 index 0000000..f10eb95 --- /dev/null +++ b/data/shapes/font/char_rparen.shp @@ -0,0 +1,9 @@ +# char_rparen.shp - Símbol ) (parèntesi dret) +# Dimensions: 20×40 (blocky display) + +name: char_rparen +scale: 1.0 +center: 10, 20 + +# Arc cap a la dreta aproximat amb 4 trams rectes +polyline: 6,4 12,12 14,20 12,28 6,36 diff --git a/source/core/graphics/vector_text.cpp b/source/core/graphics/vector_text.cpp index fec3639..c916980 100644 --- a/source/core/graphics/vector_text.cpp +++ b/source/core/graphics/vector_text.cpp @@ -47,7 +47,7 @@ namespace Graphics { } // Cargar símbolos - const std::string SYMBOLS[] = {".", ",", "-", ":", "!", "?", "/"}; + const std::string SYMBOLS[] = {".", ",", "-", ":", "!", "?", "/", "(", ")"}; for (const auto& sym : SYMBOLS) { char c = sym[0]; std::string filename = getShapeFilename(c); @@ -166,6 +166,10 @@ namespace Graphics { return "font/char_question.shp"; case '/': return "font/char_slash.shp"; + case '(': + return "font/char_lparen.shp"; + case ')': + return "font/char_rparen.shp"; case ' ': return ""; // Espai es maneja sin load shape diff --git a/source/core/graphics/vector_text.hpp b/source/core/graphics/vector_text.hpp index 4978c74..137cade 100644 --- a/source/core/graphics/vector_text.hpp +++ b/source/core/graphics/vector_text.hpp @@ -21,7 +21,7 @@ namespace Graphics { // Renderizar string completo // - text: cadena a renderizar (soporta: A-Z, a-z, 0-9, '.', ',', '-', ':', - // '!', '?', '/', ' ') + // '!', '?', '/', '(', ')', ' ') // - position: posición inicial (esquina superior izquierda) // - scale: factor de scale (1.0 = 20×40 px por carácter) // - spacing: espacio entre caracteres en píxeles (a scale 1.0) diff --git a/source/core/system/service_menu.cpp b/source/core/system/service_menu.cpp index fdd8913..0f046a7 100644 --- a/source/core/system/service_menu.cpp +++ b/source/core/system/service_menu.cpp @@ -631,8 +631,9 @@ namespace System { .label_key = {}, .label_text = std::move(label), .selectable = true, - .on_activate = [PI, PAD_NAME, PAD_PATH] { + .on_activate = [this, PI, PAD_NAME, PAD_PATH] { assignPadToPlayer(PI, PAD_NAME, PAD_PATH); + popPage(); }, .get_value_text = {}, .on_change = {}, @@ -646,7 +647,10 @@ namespace System { .label_key = "service_menu.controls_no_pad", .label_text = {}, .selectable = true, - .on_activate = [PI] { assignPadToPlayer(PI, {}, {}); }, + .on_activate = [this, PI] { + assignPadToPlayer(PI, {}, {}); + popPage(); + }, .get_value_text = {}, .on_change = {}, }); diff --git a/source/core/system/service_menu.hpp b/source/core/system/service_menu.hpp index 49cbca8..d3bd8b4 100644 --- a/source/core/system/service_menu.hpp +++ b/source/core/system/service_menu.hpp @@ -109,9 +109,10 @@ namespace System { [[nodiscard]] auto buildSystemPage() -> Page; [[nodiscard]] auto buildControlsPage() -> Page; // Llista de mandos detectats per a un jugador. Cada item assigna el - // pad triat (amb swap automatic si l'altre jugador ja el tenia). - // L'ultim item es "SENSE MANDO" per a desasignar. - [[nodiscard]] static auto buildPadPickerPage(int player_index) -> Page; + // pad triat (amb swap automatic si l'altre jugador ja el tenia) i + // tanca la picker amb popPage. L'ultim item es "SENSE MANDO" per a + // desasignar. + [[nodiscard]] auto buildPadPickerPage(int player_index) -> Page; // Pagina de confirmacio "ESTAS SEGUR? NO/SI". on_yes s'executa si // l'usuari selecciona SI; el cursor per defecte apunta a NO. void pushConfirmPage(const std::string& title_key, std::function on_yes);