online and offline highscores are now better displayed
parent
6a06285dc9
commit
48bf4a4a62
|
@ -851,25 +851,48 @@ void View::DrawHighscoreEntry (float x, float y, float entry_width, const std::s
|
|||
}
|
||||
|
||||
void View::DrawUiHighscore() {
|
||||
DrawPageTitle ("Highscores");
|
||||
// DrawPageTitle but centered:
|
||||
SelectFont("console.ttf size=46 color=#808080");
|
||||
|
||||
float width, height;
|
||||
DrawGLStringMeasure("Highscores", &width, &height);
|
||||
|
||||
float xpos = (screen_right - width) * 0.5;
|
||||
float ypos = 180;
|
||||
Engine::GUI::Label (4, "Highscores", xpos - 2, ypos + 2);
|
||||
|
||||
SelectFont("console.ttf size=46 color=#ffffff");
|
||||
Engine::GUI::Label (4, "Highscores", xpos, ypos);
|
||||
|
||||
if (GetModel()->GetHighscoreIsOnline()) {
|
||||
SelectFont("console.ttf size=23 color=#006600");
|
||||
SelectFont("console.ttf size=23 color=#887500");
|
||||
std::string title= "-online-";
|
||||
float width, height;
|
||||
DrawGLStringMeasure(title.c_str(), &width, &height);
|
||||
|
||||
float xpos = (screen_right - width) * 0.5 - 40;
|
||||
float xpos = (screen_right - width) * 0.5;
|
||||
float ypos = 130;
|
||||
Engine::GUI::Label (4, title.c_str(), xpos - 2, ypos + 2);
|
||||
Engine::GUI::Label (4, title.c_str(), xpos - 1, ypos + 1);
|
||||
|
||||
SelectFont("console.ttf size=23 color=#00cf00");
|
||||
SelectFont("console.ttf size=23 color=#e8d500");
|
||||
Engine::GUI::Label (4, title.c_str(), xpos, ypos);
|
||||
} else {
|
||||
SelectFont("console.ttf size=23 color=#808080");
|
||||
std::string title= "-offline-";
|
||||
float width, height;
|
||||
DrawGLStringMeasure(title.c_str(), &width, &height);
|
||||
|
||||
float xpos = (screen_right - width) * 0.5;
|
||||
float ypos = 130;
|
||||
Engine::GUI::Label (4, title.c_str(), xpos - 1, ypos + 1);
|
||||
|
||||
SelectFont("console.ttf size=23 color=#ffffff");
|
||||
Engine::GUI::Label (4, title.c_str(), xpos, ypos);
|
||||
}
|
||||
|
||||
SelectFont ("console.ttf size=23");
|
||||
unsigned int entry_length = 32;
|
||||
float char_width, height;
|
||||
float char_width;
|
||||
DrawGLStringMeasure ("M", &char_width, &height);
|
||||
height = fabsf(height);
|
||||
float entry_width = fabsf(char_width * entry_length);
|
||||
|
|
Loading…
Reference in New Issue