summaryrefslogtreecommitdiff
path: root/apps/plugins/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib')
-rw-r--r--apps/plugins/lib/highscore.c17
-rw-r--r--apps/plugins/lib/highscore.h4
2 files changed, 15 insertions, 6 deletions
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c
index 909c3a8..280c0c7 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,
}
#ifdef HAVE_LCD_BITMAP
-void highscore_show(int position, struct highscore *scores, int num_scores)
+void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level)
{
int i, w, h;
char str[30];
@@ -141,7 +141,11 @@ void highscore_show(int position, struct highscore *scores, int num_scores)
}
rb->lcd_putsxy(LCD_WIDTH/2-w/2, MARGIN, "High Scores");
rb->lcd_putsxy(LCD_WIDTH/4-w/4,2*h, "Score");
- rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level");
+
+ /* Decide whether to display the level column or not */
+ if(show_level) {
+ rb->lcd_putsxy(LCD_WIDTH*3/4-w/4,2*h, "Level");
+ }
for (i = 0; i<num_scores; i++)
{
@@ -154,8 +158,13 @@ void highscore_show(int position, struct highscore *scores, int num_scores)
rb->lcd_putsxy (MARGIN,3*h + h*i, str);
rb->snprintf (str, sizeof (str), "%d", scores[i].score);
rb->lcd_putsxy (LCD_WIDTH/4-w/4,3*h + h*i, str);
- rb->snprintf (str, sizeof (str), "%d", scores[i].level);
- rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str);
+
+ /* Decide whether to display the level column or not */
+ if(show_level) {
+ rb->snprintf (str, sizeof (str), "%d", scores[i].level);
+ rb->lcd_putsxy (LCD_WIDTH*3/4-w/4,3*h + h*i, str);
+ }
+
if(i == position) {
#ifdef HAVE_LCD_COLOR
rb->lcd_set_foreground(LCD_WHITE);
diff --git a/apps/plugins/lib/highscore.h b/apps/plugins/lib/highscore.h
index 173e389..18c14a7 100644
--- a/apps/plugins/lib/highscore.h
+++ b/apps/plugins/lib/highscore.h
@@ -27,7 +27,7 @@ struct highscore
{
char name[32];
int score;
- int level;
+ int level;
};
/* Saves the scores to a file
@@ -91,6 +91,6 @@ bool highscore_would_update(int score, struct highscore *scores,
* - scores : the array of existing scores
* - num_scores: number of elements in 'scores'
*/
-void highscore_show(int position, struct highscore *scores, int num_scores);
+void highscore_show(int position, struct highscore *scores, int num_scores, bool show_level);
#endif
#endif