summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/highscore.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/highscore.c')
-rw-r--r--apps/plugins/lib/highscore.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c
index 909c3a89ef..280c0c7724 100644
--- a/apps/plugins/lib/highscore.c
+++ b/apps/plugins/lib/highscore.c
@@ -120,7 +120,7 @@ bool highscore_would_update(int score, struct highscore *scores,
120} 120}
121 121
122#ifdef HAVE_LCD_BITMAP 122#ifdef HAVE_LCD_BITMAP
123void highscore_show(int position, struct highscore *scores, int num_scores) 123void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level)
124{ 124{
125 int i, w, h; 125 int i, w, h;
126 char str[30]; 126 char str[30];
@@ -141,7 +141,11 @@ void highscore_show(int position, struct highscore *scores, int num_scores)
141 } 141 }
142 rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores"); 142 rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores");
143 rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score"); 143 rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score");
144 rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level"); 144
145 /* Decide whether to display the level column or not */
146 if(show_level) {
147 rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level");
148 }
145 149
146 for (i = 0; i<num_scores; i++) 150 for (i = 0; i<num_scores; i++)
147 { 151 {
@@ -154,8 +158,13 @@ void highscore_show(int position, struct highscore *scores, int num_scores)
154 rb->lcd_putsxy (MARGIN,3*h + h*i, str); 158 rb->lcd_putsxy (MARGIN,3*h + h*i, str);
155 rb->snprintf (str, sizeof (str), "%d", scores[i].score); 159 rb->snprintf (str, sizeof (str), "%d", scores[i].score);
156 rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str); 160 rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str);
157 rb->snprintf (str, sizeof (str), "%d", scores[i].level); 161
158 rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str); 162 /* Decide whether to display the level column or not */
163 if(show_level) {
164 rb->snprintf (str, sizeof (str), "%d", scores[i].level);
165 rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str);
166 }
167
159 if(i == position) { 168 if(i == position) {
160#ifdef HAVE_LCD_COLOR 169#ifdef HAVE_LCD_COLOR
161 rb->lcd_set_foreground(LCD_WHITE); 170 rb->lcd_set_foreground(LCD_WHITE);