Skip to content

Commit

Permalink
FORMAT-AUTO: automatic format on pull request #142
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 5, 2023
1 parent beefec2 commit 0b30201
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
19 changes: 14 additions & 5 deletions src/Client/Systems/Menus/Menu/ButtonCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include "B-luga/SceneManager.hpp"
#include "B-luga/SystemManagers/SystemManagersDirector.hpp"
#include "NitworkClient.hpp"
#include "Parallax.hpp"
#include "ResourcesManager.hpp"
#include "SelectLobbySystems.hpp"
#include "Parallax.hpp"
#include "init.hpp"

namespace Menu {
Expand Down Expand Up @@ -199,10 +199,19 @@ namespace Menu {
{
auto ids = Registry::getInstance().getEntitiesByComponents({typeid(Types::Parallax)});

switch(Systems::Parallax::ActualParallax::getInstance().getActualParallaxType()) {
case JsonType::DEFAULT_PARALLAX: Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(JsonType::PARALLAX_2); break;
case JsonType::PARALLAX_2: Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(JsonType::DEFAULT_PARALLAX); break;
default: Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(JsonType::DEFAULT_PARALLAX); break;
switch (Systems::Parallax::ActualParallax::getInstance().getActualParallaxType()) {
case JsonType::DEFAULT_PARALLAX:
Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(
JsonType::PARALLAX_2);
break;
case JsonType::PARALLAX_2:
Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(
JsonType::DEFAULT_PARALLAX);
break;
default:
Systems::Parallax::ActualParallax::getInstance().setActualParralaxType(
JsonType::DEFAULT_PARALLAX);
break;
}
}
} // namespace Callback
Expand Down
40 changes: 23 additions & 17 deletions src/Client/Systems/Menus/Menu/ButtonCallbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ namespace Menu {
{GO_SELECT_LOBBY, "goToSelectLobby" },
{CREATE_NORMAL, "onButtonCreateLobbyNormalClicked"},
{SEND_READY, "sendReadyPacket" },
{GO_CREATE_SERVER, "goCreateServer" },
{CREATE_SERVER, "createServer" },
{GO_MENU, "goToMenu" },
{CHANGE_PARALLAX, "changeParallax" }
{GO_CREATE_SERVER, "goCreateServer" },
{CREATE_SERVER, "createServer" },
{GO_MENU, "goToMenu" },
{CHANGE_PARALLAX, "changeParallax" }
});

void initConnection();
Expand Down Expand Up @@ -75,19 +75,25 @@ namespace Menu {
void changeParallax();

const std::unordered_map<CallbackType, std::function<void()>> callbacks = {
{CallbackType::DEFAULT_CALLBACK, &defaultCallBack },
{CallbackType::INIT_CONNECTION, &initConnection },
{CallbackType::CONNECT, &connectLobbySelected },
{CallbackType::CREATE, &onButtonGotoCreateLobbyClicked },
{CallbackType::GO_SELECT_LOBBY, &gotToSelectLobby },
{CallbackType::GO_BACK, &goBackPage },
{CallbackType::GO_NEXT, &goNextPage },
{CallbackType::CREATE_NORMAL, &onButtonCreateLobbyNormalClicked},
{CallbackType::SEND_READY, &sendReadyPacket },
{CallbackType::GO_CREATE_SERVER, &goCreateServer },
{CallbackType::CREATE_SERVER, &createServer },
{CallbackType::GO_MENU, &goMenu, },
{CallbackType::CHANGE_PARALLAX, &changeParallax, },
{CallbackType::DEFAULT_CALLBACK, &defaultCallBack},
{CallbackType::INIT_CONNECTION, &initConnection},
{CallbackType::CONNECT, &connectLobbySelected},
{CallbackType::CREATE, &onButtonGotoCreateLobbyClicked},
{CallbackType::GO_SELECT_LOBBY, &gotToSelectLobby},
{CallbackType::GO_BACK, &goBackPage},
{CallbackType::GO_NEXT, &goNextPage},
{CallbackType::CREATE_NORMAL, &onButtonCreateLobbyNormalClicked},
{CallbackType::SEND_READY, &sendReadyPacket},
{CallbackType::GO_CREATE_SERVER, &goCreateServer},
{CallbackType::CREATE_SERVER, &createServer},
{
CallbackType::GO_MENU,
&goMenu,
},
{
CallbackType::CHANGE_PARALLAX,
&changeParallax,
},
};
} // namespace Callback
} // namespace Menu
5 changes: 3 additions & 2 deletions src/Client/Systems/Parallax/Parallax.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Parallax.hpp"
#include <nlohmann/json.hpp>
#include "B-luga-graphics/GraphicsSystems.hpp"
#include "B-luga/Json.hpp"
#include "Parallax.hpp"

namespace Systems::Parallax {

Expand Down Expand Up @@ -42,7 +42,8 @@ namespace Systems::Parallax {
{
std::lock_guard<std::mutex> lock(Registry::getInstance().mutex);
std::vector<nlohmann::basic_json<>> parallaxData = Json::getInstance().getDataByJsonType(
ResourcesManager::getPathByJsonType(Parallax::ActualParallax::getInstance().getActualParallaxType()),
ResourcesManager::getPathByJsonType(
Parallax::ActualParallax::getInstance().getActualParallaxType()),
"parallax");

for (auto &elem : parallaxData) {
Expand Down

0 comments on commit 0b30201

Please sign in to comment.