diff --git a/source/enter_id.cpp b/source/enter_id.cpp index fe95a14..5fd27f4 100644 --- a/source/enter_id.cpp +++ b/source/enter_id.cpp @@ -37,6 +37,7 @@ EnterID::EnterID(SDL_Renderer *renderer, Screen *screen, Asset *asset, Lang *lan counter = 0; ticks = 0; ticksSpeed = 15; + jailerIDPos = 0; initName(); // Escribe el texto en la textura @@ -124,6 +125,7 @@ void EnterID::checkEvents() else if (eventHandler->key.keysym.scancode == SDL_SCANCODE_ESCAPE) { section->name = SECTION_PROG_QUIT; + loopRunning = false; break; } @@ -186,7 +188,7 @@ void EnterID::render() // Escribe el jailerID const std::string jailerID = (std::string)name + cursor; const color_t color = stringToColor(options->palette, "white"); - text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, (16 * 8 + 1), jailerID, 1, color); + text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, jailerIDPos, jailerID, 1, color); // Vuelca el contenido del renderizador en pantalla screen->blit(); @@ -195,36 +197,26 @@ void EnterID::render() // Inicializa los textos void EnterID::iniTexts() { + const color_t orangeColor = {0xFF, 0x7A, 0x00}; + const color_t noColor = {0xFF, 0xFF, 0xFF}; + texts.clear(); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({lang->getText(89), stringToColor(options->palette, "red")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({lang->getText(90), stringToColor(options->palette, "white")}); - texts.push_back({lang->getText(91), stringToColor(options->palette, "white")}); - texts.push_back({lang->getText(92), stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"JAILER_ID:", stringToColor(options->palette, "red")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); - texts.push_back({"", stringToColor(options->palette, "white")}); + texts.push_back({lang->getText(89), orangeColor}); + texts.push_back({"", noColor}); + texts.push_back({lang->getText(90), noColor}); + texts.push_back({lang->getText(91), noColor}); + texts.push_back({lang->getText(92), noColor}); + texts.push_back({"", noColor}); + texts.push_back({"", noColor}); + texts.push_back({"", noColor}); + texts.push_back({"JAILER_ID:", orangeColor}); } // Escribe el texto en la textura void EnterID::fillTexture() { + const color_t shdwTxtColor = {0x43, 0x43, 0x4F}; + // Inicializa los textos iniTexts(); @@ -234,14 +226,16 @@ void EnterID::fillTexture() SDL_RenderClear(renderer); // Escribe el texto en la textura - const int size = text->getCharacterSize(); + const int desp = 40; + const int size = text->getCharacterSize() + 2; int i = 0; for (auto t : texts) { - text->writeDX(TXT_CENTER | TXT_COLOR, PLAY_AREA_CENTER_X, i * size, t.label, 1, t.color); + text->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, PLAY_AREA_CENTER_X, (i * size) + desp, t.label, 1, t.color, 1, shdwTxtColor); i++; } + jailerIDPos = ((i + 1) * size) + desp; SDL_SetRenderTarget(renderer, nullptr); } @@ -272,7 +266,7 @@ void EnterID::initOnline() #else const std::string caption = options->online.jailerID; #endif - //screen->showNotification(caption, lang->getText(85), 12); + // screen->showNotification(caption, lang->getText(85), 12); screen->showNotification(caption, lang->getText(85)); if (options->console) { diff --git a/source/enter_id.h b/source/enter_id.h index b7b11df..ede8bbf 100644 --- a/source/enter_id.h +++ b/source/enter_id.h @@ -45,6 +45,7 @@ private: int pos; // Posición actual en el vector name int maxLenght; // Tamaño máximo del jailerID std::string oldJailerID; // Almacena el valor de jailerID al inicio para ver si se ha modificado + int jailerIDPos; // Posición en el eje Y donde ser va a escribir el texto // Actualiza las variables void update();