Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of el17ajf by
Diff: Menus/ScoresMenu/ScoresMenu.cpp
- Revision:
- 32:7b5a864b9234
- Parent:
- 29:d59fbe128d1f
- Child:
- 34:0bb0d010e755
diff -r 69fedaa9b171 -r 7b5a864b9234 Menus/ScoresMenu/ScoresMenu.cpp
--- a/Menus/ScoresMenu/ScoresMenu.cpp Sat Apr 13 09:53:39 2019 +0000
+++ b/Menus/ScoresMenu/ScoresMenu.cpp Sat Apr 13 09:58:45 2019 +0000
@@ -2,8 +2,8 @@
#include "Prefs.h"
Menus::ScoresMenu::ScoresMenu() {
- lastPlayerPos = -1;
- int lastPlayer = Prefs::getInstance()->getKey(Prefs::LAST_PLAYER);
+ last_player_pos = -1;
+ int last_player = Prefs::getInstance()->getKey(Prefs::LAST_PLAYER);
int highscores[3];
int players[3];
@@ -18,17 +18,17 @@
for (int i = 0; i < 3; i++) {
if (players[i] == Prefs::EMPTY) {
- sprintf(playersLables[i], "%1d. ---", i + 1);
- sprintf(highscoresLabels[i], " ");
+ sprintf(players_lables[i], "%1d. ---", i + 1);
+ sprintf(highscores_labels[i], " ");
} else {
- sprintf(playersLables[i], "%1d.PLYR %2d", i + 1, players[i]);
- sprintf(highscoresLabels[i], " %4dPTS", highscores[i]);
+ sprintf(players_lables[i], "%1d.PLYR %2d", i + 1, players[i]);
+ sprintf(highscores_labels[i], " %4dPTS", highscores[i]);
}
}
for (int i = 0; i < 3; i++) {
- if (players[i] == lastPlayer) {
- lastPlayerPos = i;
+ if (players[i] == last_player) {
+ last_player_pos = i;
}
}
}
@@ -37,12 +37,12 @@
ui->drawTitle("hi scores");
ui->newLine();
for (int i = 0; i < 3; i++) {
- if (i == lastPlayerPos) {
- ui->drawFlashingLabel(playersLables[i]);
- ui->drawFlashingLabel(highscoresLabels[i]);
+ if (i == last_player_pos) {
+ ui->drawFlashingLabel(players_lables[i]);
+ ui->drawFlashingLabel(highscores_labels[i]);
} else {
- ui->drawLabel(playersLables[i]);
- ui->drawLabel(highscoresLabels[i]);
+ ui->drawLabel(players_lables[i]);
+ ui->drawLabel(highscores_labels[i]);
}
}
if (ui->drawAndCheckButton("back")) {
