- // fetch the high score later
- text = widestring("High score: ") + widestring(pqxx::to_string(1234)) +
- widestring(", by dufF in Challenge Cup 1, 2004");
- this_width = my_draw_text(text, NULL, 16.0);
- my_draw_text(text, buf, 16.0, 400 - this_width/2, 487);
+ Highscore hs;
+ conn.perform(FetchHighscore(next_song->song.id, &hs));
+
+ if (hs.score != -1) {
+ text = widestring("High score: ") + widestring(pqxx::to_string(hs.score)) +
+ widestring(", by ") + hs.nick + widestring(" in ") + hs.tournament_name;
+ this_width = my_draw_text(text, NULL, 16.0);
+ my_draw_text(text, buf, 16.0, 400 - this_width/2, 487);
+ }