From 4a0235f95dac85068cf3654ef95832608b3cdc49 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 10 Jan 2015 20:58:45 +0100 Subject: emphasize the categories in the action list Signed-off-by: Olivier Gayot --- blits.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/blits.c b/blits.c index 72a33fa..2e79342 100644 --- a/blits.c +++ b/blits.c @@ -201,6 +201,9 @@ void update_list_entries(SURFACES *surfaces, POSITIONS *positions, const struct off = selected / 3 * 3; /* display at most three actions */ for (int i = 0; i < 3; ++i) { + const char *string; + char buffer[256]; + if (off + i >= cnt) { SDL_BlitSurface(surfaces->Pactiondesactivee, NULL, surfaces->Pecran, &positions->Vpositionactionselectionnee[i]); continue; @@ -211,7 +214,14 @@ void update_list_entries(SURFACES *surfaces, POSITIONS *positions, const struct SDL_BlitSurface(surfaces->Pactionselectionnee, NULL, surfaces->Pecran, &positions->Vpositionactionselectionnee[i]); } - surf = TTF_RenderText_Blended(rpg_g.font, entries[off + i].name, color); + if (entries[off + i].children_cnt) { + snprintf(buffer, sizeof(buffer), "+ %s", entries[off + i].name); + string = buffer; + } else { + string = entries[off + i].name; + } + + surf = TTF_RenderText_Blended(rpg_g.font, string, color); SDL_BlitSurface(surf, NULL, surfaces->Pecran, &positions->Vpositionnomactions[i]); -- cgit v1.2.3