fix game over
This commit is contained in:
1 parent
7418bbbe27
commit
c20e82634a
10 files changed
+94
-31
No files matched your search
+7
-4
@@ -38,7 +38,7 @@ namespace ZL {
|
||||
uiManager.startAnimationOnNode("backgroundNode", "bgScroll");
|
||||
static bool isExitButtonAnimating = false;
|
||||
uiManager.setAnimationCallback("settingsButton", "buttonsExit", [this]() {
|
||||
std::cerr << "Settings button animation finished -> переход в настройки" << std::endl;
|
||||
std::cerr << "Settings button animation finished -> ??????? ? ?????????" << std::endl;
|
||||
if (uiManager.pushMenuFromSavedRoot(settingsSavedRoot)) {
|
||||
uiManager.setButtonCallback("Opt1", [this](const std::string& n) {
|
||||
std::cerr << "Opt1 pressed: " << n << std::endl;
|
||||
@@ -184,7 +184,7 @@ namespace ZL {
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("multiplayerButton2", [this](const std::string& name) {
|
||||
std::cerr << "Multiplayer button pressed → opening multiplayer menu\n";
|
||||
std::cerr << "Multiplayer button pressed ? opening multiplayer menu\n";
|
||||
|
||||
uiManager.startAnimationOnNode("playButton", "buttonsExit");
|
||||
uiManager.startAnimationOnNode("settingsButton", "buttonsExit");
|
||||
@@ -227,14 +227,17 @@ namespace ZL {
|
||||
});
|
||||
}
|
||||
|
||||
void MenuManager::showGameOver()
|
||||
void MenuManager::showGameOver(int score)
|
||||
{
|
||||
if (!uiGameOverShown) {
|
||||
if (uiManager.pushMenuFromSavedRoot(gameOverSavedRoot)) {
|
||||
uiManager.setText("scoreText", std::string("Score: ") + std::to_string(score));
|
||||
|
||||
uiManager.setButtonCallback("restartButton", [this](const std::string& name) {
|
||||
uiManager.setText("scoreText", "");
|
||||
uiGameOverShown = false;
|
||||
uiManager.popMenu();
|
||||
onRestartPressed();
|
||||
if (onRestartPressed) onRestartPressed();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("gameOverExitButton", [this](const std::string& name) {
|
||||
|
||||
Reference in new issue
Block a user