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