Skip to content

Commit

Permalink
CLIENT-GAME: Add list-libby menu (begin)
Browse files Browse the repository at this point in the history
MINOR
  • Loading branch information
romainpanno committed Oct 30, 2023
1 parent 7cf4ac0 commit 543c9d8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 35 deletions.
84 changes: 54 additions & 30 deletions assets/Json/selectLobby.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
{
"menu": {
"lobbyMenu": {
"bigBox": {
"type": "box",
"spritePath": "assets/Menu/bix-box.png",
"width": 5000,
"height": 5000,
"position": {
"x": 2000,
"y": 1000
},
"rect": {
"x": 0.0,
"y": 0.0,
"width": 2312.0,
"height": 1518.0
}
},
"name": {
"name": "name",
"type": "input",
"font": "assets/Fonts/soliden/SolidenTrial-Black.otf",
"spritePath": "assets/R-TypeSheet/r-typesheet1.gif",
"spritePath": "assets/Menu/input-box.png",
"text": "ServerOfSaverio",
"color": "red",
"textSize": 3,
"textSize": 2,
"maxChar": 30,
"width": 500,
"height": 500,
"width": 6000,
"height": 800,
"textPosition": {
"x": 3050,
"y": 2250
},
"position" : {
"x": 2000,
"y": 2000
},
"rect": {
"x": 101.0,
"x": 0.0,
"y": 0.0,
"width": 32.0,
"height": 19.0
"width": 1670.0,
"height": 278.0
},
"collisionRect": {
"width": 2000,
"height": 500
"width": 4500,
"height": 800
},
"animRect": [
{
Expand All @@ -32,10 +52,10 @@
"noIncr": true,
"list": [
{
"x" : 233.0,
"y": 2.0,
"width": 32.0,
"height": 14.0
"x" : 1670.0,
"y": 0.0,
"width": 1670.0,
"height": 278.0
}
]
}
Expand All @@ -45,26 +65,30 @@
"name": "maxNb",
"type": "input",
"font": "assets/Fonts/soliden/SolidenTrial-Black.otf",
"spritePath": "assets/R-TypeSheet/r-typesheet1.gif",
"spritePath": "assets/Menu/input-box.png",
"text": "2",
"color": "red",
"textSize": 3,
"maxChar": 2,
"width": 500,
"height": 500,
"width": 6000,
"height": 800,
"textPosition": {
"x": 3050,
"y": 3180
},
"position" : {
"x": 2000,
"y": 3000
},
"rect": {
"x": 101.0,
"x": 0.0,
"y": 0.0,
"width": 32.0,
"height": 19.0
"width": 1670.0,
"height": 278.0
},
"collisionRect": {
"width": 2000,
"height": 500
"width": 4500,
"height": 800
},
"animRect": [
{
Expand All @@ -73,25 +97,25 @@
"noIncr": true,
"list": [
{
"x" : 233.0,
"y": 2.0,
"width": 32.0,
"height": 14.0
"x" : 1670.0,
"y": 0.0,
"width": 1670.0,
"height": 278.0
}
]
}
]
},
"gametype_normal": {
"type": "button",
"spritePath": "assets/R-TypeSheet/r-typesheet2.gif",
"spritePath": "assets/Menu/button.png",
"width": 500,
"height": 500,
"rect": {
"x": 101.0,
"x": 0.0,
"y": 0.0,
"width": 32.0,
"height": 19.0
"width": 1366.0,
"height": 406.0
},
"position": {
"x": 2000,
Expand Down
8 changes: 5 additions & 3 deletions src/Client/Systems/Menus/SelectLobby/SelectLobbySystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ namespace Systems::SelectLobbySystems {
return;
}
try {
nlohmann::json bigBox = Json::getInstance().getDataByVector({"lobbyMenu", "bigBox"}, JsonType::SELECT_LOBBY);
nlohmann::json createLobbyNormalButton =
Json::getInstance().getDataByVector({"menu", "gametype_normal"}, JsonType::SELECT_LOBBY);
Json::getInstance().getDataByVector({"lobbyMenu", "gametype_normal"}, JsonType::SELECT_LOBBY);
nlohmann::json lobbyName =
Json::getInstance().getDataByVector({"menu", "name"}, JsonType::SELECT_LOBBY);
Json::getInstance().getDataByVector({"lobbyMenu", "name"}, JsonType::SELECT_LOBBY);
nlohmann::json maxNbPlayer =
Json::getInstance().getDataByVector({"menu", "maxNb"}, JsonType::SELECT_LOBBY);
Json::getInstance().getDataByVector({"lobbyMenu", "maxNb"}, JsonType::SELECT_LOBBY);
Menu::MenuBuilder::getInstance().initMenuEntity(
createLobbyNormalButton,
onButtonCreateLobbyNormalClicked);
Menu::MenuBuilder::getInstance().initMenuEntity(bigBox);
Menu::MenuBuilder::getInstance().initMenuEntity(lobbyName);
Menu::MenuBuilder::getInstance().initMenuEntity(maxNbPlayer);
} catch (const std::exception &err) {
Expand Down
4 changes: 2 additions & 2 deletions src/ServerArgsHandling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace Args {
constexpr int LOBBY_SERVER = 1;
static constexpr auto LOBBY_SERVER_ARG = "1";
static constexpr int MAX_LOBBY_ARGS = 6;
static constexpr int MAX_LOBBY_NAME_SIZE = 20;
static constexpr int MAX_LOBBY_IP_SIZE = 15;
static constexpr int MAX_LOBBY_NAME_SIZE = 32;
static constexpr int MAX_LOBBY_IP_SIZE = 16;

class ServerArgsHandling {
public:
Expand Down

0 comments on commit 543c9d8

Please sign in to comment.