leaderboard

This commit is contained in:
2026-05-20 07:32:57 +02:00
parent 66c5e0e710
commit ee3c263547
6 changed files with 266 additions and 11 deletions

View File

@@ -33,18 +33,28 @@ namespace Game::AGame {
};
if (GameManager::getSharedData<bool>("gameLost")) {
if (getText() != "Umrl si!") {
const std::string s = "Umrl si!";
Window::Window::postToMainThread([this, s]() { setText(s); });
const std::string leaderboardText = GameManager::getSharedData<std::string>("leaderboardText");
std::string endText = "Umrl si!";
if (!leaderboardText.empty()) {
endText += "\n\n" + leaderboardText;
}
if (getText() != endText) {
Window::Window::postToMainThread([this, endText]() { setText(endText); });
}
anchorTopRight();
return;
}
if (GameManager::getSharedData<bool>("gameWon")) {
if (getText() != "Zmagal si!") {
const std::string s = "Zmagal si!";
Window::Window::postToMainThread([this, s]() { setText(s); });
const std::string leaderboardText = GameManager::getSharedData<std::string>("leaderboardText");
std::string endText = "Zmagal si!";
if (!leaderboardText.empty()) {
endText += "\n\n" + leaderboardText;
}
if (getText() != endText) {
Window::Window::postToMainThread([this, endText]() { setText(endText); });
}
anchorTopRight();
return;