diff --git a/game/galaxy_menu.cpp b/game/galaxy_menu.cpp index d3e2972..70598b4 100755 --- a/game/galaxy_menu.cpp +++ b/game/galaxy_menu.cpp @@ -13,6 +13,11 @@ GalaxyMenu::~GalaxyMenu() { } +void GalaxyMenu::setTimerActivity(bool value) +{ + timer_active = value; +} + bool GalaxyMenu::InitGalaxyMenu(std::string config_json, float scale) { try { @@ -244,6 +249,7 @@ void GalaxyMenu::DrawGalaxyMenu() { } void GalaxyMenu::InteractWithGalaxy(size_t dt) { + if (timer_active) { // ::::::::::::: timer active :::::::::::::: if (menuState == 0) { // main view @@ -310,7 +316,6 @@ void GalaxyMenu::InteractWithGalaxy(size_t dt) { if (starIndex != -1) { planetHoverIndex = starIndex; Application->SetupGalaxyUi(starIndex); - ResourceManager->newGuiManager.findWidgetByName("modal_background")->setVisibility(true); } timer_active = false; diff --git a/game/galaxy_menu.h b/game/galaxy_menu.h index 4ac87b0..57195a0 100755 --- a/game/galaxy_menu.h +++ b/game/galaxy_menu.h @@ -47,6 +47,8 @@ public: void tapUp(Eigen::Vector2f pos); void tapMove(Eigen::Vector2f shift); + void setTimerActivity(bool value); + private: diff --git a/game/main_code.cpp b/game/main_code.cpp index 273d217..e764ce7 100755 --- a/game/main_code.cpp +++ b/game/main_code.cpp @@ -606,8 +606,9 @@ void TMyApplication::LoadGalaxyUi() std::shared_ptr modal_background = ResourceManager->newGuiManager.findWidgetByName("modal_background"); modal_background->onMouseUpSignal.connect( - [modal_background](Vector2f v, int i) { - modal_background->visible = false; + [modal_background, this](Vector2f v, int i) { + modal_background->setVisibility(false); + Menu.GalaxMenu.setTimerActivity(false); }); } @@ -624,6 +625,10 @@ void TMyApplication::SetupGalaxyUi(size_t levelStar) size_t levelCount = this->Menu.GalaxMenu.galaxies[0].Stars[levelStar].selectionMenu.gameLevels.size(); + ResourceManager->newGuiManager.startEditing(); + + modal_background->setVisibility(true); + if (levelCount <= 3) { row2->setVisibility(false); @@ -665,8 +670,6 @@ void TMyApplication::SetupGalaxyUi(size_t levelStar) currentLevelButton->onMouseUpSignal.disconnect_all_slots(); - - if (levelIndex < levelCount) { @@ -683,7 +686,7 @@ void TMyApplication::SetupGalaxyUi(size_t levelStar) currentLevelButton->onMouseUpSignal.connect( [this, modal_background, levelStar, levelIndex](Vector2f v, int i) { - modal_background->visible = false; + modal_background->setVisibility(false); std::shared_ptr lvl = this->Menu.GalaxMenu.galaxies[0].Stars[levelStar].selectionMenu.gameLevels[levelIndex]; lvl->ReloadLevel(); @@ -693,6 +696,8 @@ void TMyApplication::SetupGalaxyUi(size_t levelStar) } else { + currentLevelButton->setVisibility(true); + currentLevelButton->setBackground(levelName + "_prerender_blackandwhite"); } @@ -705,9 +710,10 @@ void TMyApplication::SetupGalaxyUi(size_t levelStar) } } - + ResourceManager->newGuiManager.finishEditing(); + }