fixed highscores

This commit is contained in:
2025-12-21 21:33:31 +01:00
parent fb82ac06d0
commit 70946fc720
5 changed files with 104 additions and 57 deletions

View File

@ -174,9 +174,9 @@ void MenuState::onEnter() {
try {
std::thread([this]() {
try {
auto c_classic = supabase::FetchHighscores("classic", 12);
auto c_coop = supabase::FetchHighscores("cooperate", 12);
auto c_challenge = supabase::FetchHighscores("challenge", 12);
auto c_classic = supabase::FetchHighscores("classic", 10);
auto c_coop = supabase::FetchHighscores("cooperate", 10);
auto c_challenge = supabase::FetchHighscores("challenge", 10);
std::vector<ScoreEntry> combined;
combined.reserve(c_classic.size() + c_coop.size() + c_challenge.size());
combined.insert(combined.end(), c_classic.begin(), c_classic.end());
@ -801,7 +801,9 @@ void MenuState::render(SDL_Renderer* renderer, float logicalScale, SDL_Rect logi
// Move the whole block slightly up to better match the main screen overlay framing.
float menuYOffset = LOGICAL_H * 0.03f; // same offset used for buttons
float scoresYOffset = -LOGICAL_H * 0.05f;
float topPlayersY = LOGICAL_H * 0.20f + contentOffsetY - panelDelta + menuYOffset + scoresYOffset;
// Move logo and highscores upward by ~10% of logical height for better vertical balance
float upwardShift = LOGICAL_H * 0.08f;
float topPlayersY = LOGICAL_H * 0.20f + contentOffsetY - panelDelta + menuYOffset + scoresYOffset - upwardShift;
float scoresStartY = topPlayersY;
if (useFont) {
// Preferred logo texture (full) if present, otherwise the small logo