This commit is contained in:
2026-05-19 22:35:10 +02:00
parent d93e71e716
commit 0b45643ef2
21 changed files with 806 additions and 235 deletions

View File

@@ -33,13 +33,19 @@ namespace Game::AGame {
};
if (GameManager::getSharedData<bool>("gameLost")) {
setText("Umrl si!");
if (getText() != "Umrl si!") {
const std::string s = "Umrl si!";
Window::Window::postToMainThread([this, s]() { setText(s); });
}
anchorTopRight();
return;
}
if (GameManager::getSharedData<bool>("gameWon")) {
setText("Zmagal si!");
if (getText() != "Zmagal si!") {
const std::string s = "Zmagal si!";
Window::Window::postToMainThread([this, s]() { setText(s); });
}
anchorTopRight();
return;
}
@@ -53,7 +59,10 @@ namespace Game::AGame {
<< " | Smeti " << GameManager::getSharedData<int>("trashActiveCount")
<< " | Sovražniki " << GameManager::getSharedData<int>("enemyActiveCount");
setText(stream.str());
const std::string newHudText = stream.str();
if (getText() != newHudText) {
Window::Window::postToMainThread([this, newHudText]() { setText(newHudText); });
}
anchorTopRight();
}
}