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:
- 29:d59fbe128d1f
- Parent:
- 28:e09b7ac11dea
- Child:
- 32:7b5a864b9234
--- a/Menus/ScoresMenu/ScoresMenu.cpp Fri Apr 12 20:53:00 2019 +0000 +++ b/Menus/ScoresMenu/ScoresMenu.cpp Sat Apr 13 08:33:49 2019 +0000 @@ -2,6 +2,9 @@ #include "Prefs.h" Menus::ScoresMenu::ScoresMenu() { + lastPlayerPos = -1; + int lastPlayer = Prefs::getInstance()->getKey(Prefs::LAST_PLAYER); + int highscores[3]; int players[3]; @@ -22,14 +25,25 @@ sprintf(highscoresLabels[i], " %4dPTS", highscores[i]); } } + + for (int i = 0; i < 3; i++) { + if (players[i] == lastPlayer) { + lastPlayerPos = i; + } + } } void Menus::ScoresMenu::updateAndDraw(UI * ui) { ui->drawTitle("hi scores"); ui->newLine(); for (int i = 0; i < 3; i++) { - ui->drawLabel(playersLables[i]); - ui->drawLabel(highscoresLabels[i]); + if (i == lastPlayerPos) { + ui->drawFlashingLabel(playersLables[i]); + ui->drawFlashingLabel(highscoresLabels[i]); + } else { + ui->drawLabel(playersLables[i]); + ui->drawLabel(highscoresLabels[i]); + } } if (ui->drawAndCheckButton("back")) { close();