leaderboard
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user