/* * GlobalLobbyWidget.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../gui/InterfaceObjectConfigurable.h" class GlobalLobbyWindow; struct GlobalLobbyAccount; struct GlobalLobbyRoom; class CListBox; class GlobalLobbyWidget : public InterfaceObjectConfigurable { GlobalLobbyWindow * window; using CreateFunc = std::function(size_t)>; std::shared_ptr buildItemList(const JsonNode &) const; CreateFunc getItemListConstructorFunc(const std::string & callbackName) const; public: explicit GlobalLobbyWidget(GlobalLobbyWindow * window); std::shared_ptr getAccountNameLabel(); std::shared_ptr getMessageInput(); std::shared_ptr getGameChat(); std::shared_ptr getAccountList(); std::shared_ptr getRoomList(); std::shared_ptr getChannelList(); std::shared_ptr getMatchList(); std::shared_ptr getGameChatHeader(); std::shared_ptr getAccountListHeader(); std::shared_ptr getRoomListHeader(); std::shared_ptr getChannelListHeader(); std::shared_ptr getMatchListHeader(); }; class GlobalLobbyChannelCardBase : public CIntObject { GlobalLobbyWindow * window; std::string channelType; std::string channelName; std::string channelDescription; void clickPressed(const Point & cursorPosition) override; std::shared_ptr backgroundOverlay; public: GlobalLobbyChannelCardBase(GlobalLobbyWindow * window, const Point & dimensions, const std::string & channelType, const std::string & channelName, const std::string & channelDescription); }; class GlobalLobbyAccountCard : public GlobalLobbyChannelCardBase { std::shared_ptr backgroundOverlay; std::shared_ptr labelName; std::shared_ptr labelStatus; public: GlobalLobbyAccountCard(GlobalLobbyWindow * window, const GlobalLobbyAccount & accountDescription); }; class GlobalLobbyRoomCard : public CIntObject { GlobalLobbyWindow * window; std::string roomUUID; std::shared_ptr backgroundOverlay; std::shared_ptr labelName; std::shared_ptr labelRoomSize; std::shared_ptr labelRoomStatus; std::shared_ptr labelDescription; std::shared_ptr buttonJoin; std::shared_ptr iconRoomSize; void clickPressed(const Point & cursorPosition) override; public: GlobalLobbyRoomCard(GlobalLobbyWindow * window, const GlobalLobbyRoom & roomDescription); }; class GlobalLobbyChannelCard : public GlobalLobbyChannelCardBase { std::shared_ptr labelName; public: GlobalLobbyChannelCard(GlobalLobbyWindow * window, const std::string & channelName); }; class GlobalLobbyMatchCard : public GlobalLobbyChannelCardBase { std::shared_ptr labelMatchDate; std::shared_ptr labelMatchOpponent; public: GlobalLobbyMatchCard(GlobalLobbyWindow * window, const GlobalLobbyRoom & matchDescription); };