Skip to content

Commit

Permalink
CLIENT-MENU: Merge the-merge to make this branch up to date
Browse files Browse the repository at this point in the history
MINOR
  • Loading branch information
KitetsuK committed Nov 5, 2023
2 parents a98b239 + 2c7a154 commit 6237434
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
33 changes: 18 additions & 15 deletions src/Client/Systems/Menus/Menu/ButtonCallbacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace Menu {
{GO_SELECT_LOBBY, "goToSelectLobby" },
{CREATE_NORMAL, "onButtonCreateLobbyNormalClicked"},
{SEND_READY, "sendReadyPacket" },
{GO_CREATE_SERVER, "goCreateServer" },
{CREATE_SERVER, "createServer" },
{GO_MENU, "goToMenu" },
{GO_CREATE_SERVER, "goCreateServer" },
{CREATE_SERVER, "createServer" },
{GO_MENU, "goToMenu" },
});

void initConnection();
Expand Down Expand Up @@ -71,18 +71,21 @@ namespace Menu {
void createServer();

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::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,
}
};
} // namespace Callback
} // namespace Menu
5 changes: 3 additions & 2 deletions src/Client/Systems/Menus/Menu/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ namespace Menu {

static std::size_t initButtonFromSprite(nlohmann::json &elem, std::function<void()> &callback)
{

std::size_t id = Registry::getInstance().addEntity();
initFromSprite(elem);
std::string name = Json::isDataExist(elem, "name") ? Json::getInstance().getDataFromJson<std::string>(elem, "name") : "";
std::string name = Json::isDataExist(elem, "name")
? Json::getInstance().getDataFromJson<std::string>(elem, "name")
: "";
Types::Button button(callback, name);
Types::Position position = {
Types::Position(Json::getInstance().getDataFromJson<Types::Position>(elem, "position"))};
Expand Down
6 changes: 3 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ void initScenes()
});
auto selectLobby = enumListTosizet(
{SystemManagers::MENU_SYSTEMS,
SystemManagers::NETWORK_MENU,
SystemManagers::ECSSYSTEMS,
SystemManagers::GRAPHICS});
SystemManagers::NETWORK_MENU,
SystemManagers::ECSSYSTEMS,
SystemManagers::GRAPHICS});
auto createLobby = enumListTosizet(
{SystemManagers::MENU_SYSTEMS,
SystemManagers::NETWORK_CREATE_LOBBY,
Expand Down

0 comments on commit 6237434

Please sign in to comment.