Mejoras en la presentación de la lista de logros
This commit is contained in:
@@ -501,6 +501,7 @@ void Director::loadResources(section_t *section)
|
||||
textureList.push_back("loading_screen_color_zxarne.png");
|
||||
textureList.push_back("smb2.png");
|
||||
textureList.push_back("debug.png");
|
||||
textureList.push_back("notify.png");
|
||||
|
||||
resource->loadTextures(textureList);
|
||||
|
||||
|
||||
@@ -66,16 +66,28 @@ Title::Title(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *
|
||||
const vector<cheevos_t> cheevosList = cheevos->list();
|
||||
int pos = 2;
|
||||
const color_t cheevoLockedColor = stringToColor(options->palette, "white");
|
||||
const color_t cheevoUnlockedColor = stringToColor(options->palette, "white");
|
||||
const color_t cheevoUnlockedColor = stringToColor(options->palette, "bright_white");
|
||||
color_t cheevoColor;
|
||||
|
||||
Texture *iconTexture = new Texture(renderer, asset->get("notify.png"));
|
||||
const int iconSize = 16;
|
||||
Sprite *sp = new Sprite({0, 0, iconSize, iconSize}, iconTexture, renderer);
|
||||
for (auto cheevo : cheevosList)
|
||||
{
|
||||
cheevoColor = cheevo.completed ? cheevoUnlockedColor : cheevoLockedColor;
|
||||
infoText->writeColored(2, pos, cheevo.caption, cheevoColor);
|
||||
//const int iconIndex = cheevo.completed ? 3 : 2;
|
||||
sp->setPos({2, pos, iconSize, iconSize});
|
||||
sp->setSpriteClip({iconSize * 2, 0, iconSize, iconSize});
|
||||
sp->getTexture()->setColor(cheevoColor.r, cheevoColor.g, cheevoColor.b);
|
||||
sp->render();
|
||||
pos += 2;
|
||||
infoText->writeColored(2 + iconSize + 2, pos, cheevo.caption, cheevoColor);
|
||||
pos += 6;
|
||||
infoText->writeColored(2, pos, cheevo.description, cheevoColor);
|
||||
pos += 8;
|
||||
infoText->writeColored(2 + iconSize + 2, pos, cheevo.description, cheevoColor);
|
||||
pos += 9;
|
||||
}
|
||||
delete sp;
|
||||
delete iconTexture;
|
||||
|
||||
// Crea el sprite para el listado de logros
|
||||
cheevosSprite = new Sprite(4, 4, cheevosTexture->getWidth(), cheevosTexture->getHeight(), cheevosTexture, renderer);
|
||||
@@ -276,9 +288,9 @@ void Title::update()
|
||||
}
|
||||
}
|
||||
|
||||
// Dibuja en pantalla
|
||||
void Title::render()
|
||||
{
|
||||
// Dibuja en pantalla
|
||||
void Title::render()
|
||||
{
|
||||
// Prepara para empezar a dibujar en la textura de juego
|
||||
screen->start();
|
||||
|
||||
@@ -305,21 +317,21 @@ void Title::update()
|
||||
|
||||
// Vuelca el contenido del renderizador en pantalla
|
||||
screen->blit();
|
||||
}
|
||||
}
|
||||
|
||||
// Bucle para el logo del juego
|
||||
void Title::run()
|
||||
{
|
||||
// Bucle para el logo del juego
|
||||
void Title::run()
|
||||
{
|
||||
while (section->name == SECTION_PROG_TITLE)
|
||||
{
|
||||
update();
|
||||
render();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recarga las texturas
|
||||
void Title::reLoadTextures()
|
||||
{
|
||||
// Recarga las texturas
|
||||
void Title::reLoadTextures()
|
||||
{
|
||||
// Carga la textura adecuada
|
||||
if (options->palette == p_zxspectrum)
|
||||
{
|
||||
@@ -333,11 +345,11 @@ void Title::update()
|
||||
}
|
||||
|
||||
texture->reLoad();
|
||||
}
|
||||
}
|
||||
|
||||
// Cambia la paleta
|
||||
void Title::switchPalette()
|
||||
{
|
||||
// Cambia la paleta
|
||||
void Title::switchPalette()
|
||||
{
|
||||
if (options->palette == p_zxspectrum)
|
||||
{
|
||||
options->palette = p_zxarne;
|
||||
@@ -351,4 +363,4 @@ void Title::update()
|
||||
|
||||
// Cambia el color del borde
|
||||
screen->setBorderColor(stringToColor(options->palette, "bright_blue"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user