From 865836b7188f02345ad4f3fa15a559a093efa681 Mon Sep 17 00:00:00 2001 From: tenshi Date: Sun, 5 Nov 2023 13:51:05 +0100 Subject: [PATCH] CLIENT-GAME: Add paralax --- src/Client/Systems/Menus/Menu/MenuSystems.cpp | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Client/Systems/Menus/Menu/MenuSystems.cpp b/src/Client/Systems/Menus/Menu/MenuSystems.cpp index 9a818157..0c60566a 100644 --- a/src/Client/Systems/Menus/Menu/MenuSystems.cpp +++ b/src/Client/Systems/Menus/Menu/MenuSystems.cpp @@ -222,17 +222,24 @@ namespace Systems { } } - // this system is not in the good file for the moment - void initHud(std::size_t managerId, std::size_t systemId) + // this two systems are not in the good file for the moment + static void initHud() + { + nlohmann::json jsonData = Json::getInstance().getDataByJsonType( + ResourcesManager::getPathByJsonType(JsonType::HUD), + "gameHud"); + ::Menu::MenuBuilder::getInstance().initMenuSceneEntity( + Json::getInstance().getDatasFromList(jsonData)); + } + + void initSceneGame(std::size_t managerId, std::size_t systemId) { if (Scene::SceneManager::getInstance().getCurrentScene() != GAME) { return; } try { - nlohmann::json jsonData = - Json::getInstance().getDataByJsonType(ResourcesManager::getPathByJsonType(JsonType::HUD), "gameHud"); - ::Menu::MenuBuilder::getInstance().initMenuSceneEntity( - Json::getInstance().getDatasFromList(jsonData)); + Parallax::initParalax(); + initHud(); } catch (std::runtime_error &err) { Logger::info(err.what()); } @@ -248,7 +255,7 @@ namespace Systems { hoverInputBox, checkTextInput, checkInputDeletion, - initHud, + initSceneGame, quitScene}; } } // namespace Menu