X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bigscreen%2Fgroupscreen.cpp;h=cd6c86edccdb596660452a30fbd2096de61ae758;hb=2983d99d9fc6a9da891873b08a8f9360d88d104a;hp=2b4aa7d7369160b42ec0275c616451eb4caefb89;hpb=f0955c93464993b82d087f48150d363c6c57054f;p=ccbs diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp index 2b4aa7d..cd6c86e 100644 --- a/bigscreen/groupscreen.cpp +++ b/bigscreen/groupscreen.cpp @@ -6,6 +6,7 @@ #include "fetch_max_score_for_song.h" #include "fetch_max_score_for_player.h" #include "fetch_needs_update.h" +#include "fetch_highscore.h" #include "fonts.h" GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel) @@ -314,11 +315,15 @@ void GroupScreen::draw(unsigned char *buf) this_width = my_draw_text(next_song->song.title, NULL, 20.0); my_draw_text(next_song->song.title, buf, 20.0, 400 - this_width/2, 457); - // 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); + } } // only show lead/win/qualify for the last song