my_draw_text_deferred(td, "Rank", 12.0, x + width[num_scores + 2] / 2 - my_draw_text("Rank", NULL, 12.0) / 2, 100);
// show all the players and the scores
- unsigned y = 140;
- for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end(); ++i) {
+ unsigned show_players = std::min(group.players.size(), 9U);
+ unsigned y = (show_players <= 7) ? 140 : (140 - (show_players - 7) * 5);
+
+ unsigned row = 0;
+ for (std::vector<Player>::const_iterator i = group.players.begin(); i != group.players.end() && row < 9; ++i, ++row) {
my_draw_text_deferred(td, i->nick, 18.0, 20, y);
unsigned x = 40 + width[0];
x += width[num_scores + 1] + 20;
}
- y += 40;
+ if (show_players > 7)
+ y += 40 - (show_players - 7) * 4;
+ else
+ y += 40;
}
/*
}
// now finally find min and max rank, and draw it all
- y = 140;
- for (unsigned i = 0; i < group.players.size(); ++i) {
+ y = (show_players <= 7) ? 140 : (140 - (show_players - 7) * 5);
+ for (unsigned i = 0; i < show_players; ++i) {
unsigned best_rank = 1, worst_rank = 1;
for (unsigned j = 0; j < group.players.size(); ++j) {
if (i == j)
unsigned this_width = my_draw_text(text, NULL, 22.0);
my_draw_text_deferred(td, text, 22.0, x + width[num_scores + 2] / 2 - this_width / 2, y);
- y += 40;
+ if (show_players > 7)
+ y += 40 - (show_players - 7) * 4;
+ else
+ y += 40;
}
/*