2023-12-27 19:07:49 +02:00
|
|
|
/*
|
|
|
|
* 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;
|
2024-01-21 16:48:36 +02:00
|
|
|
struct GlobalLobbyAccount;
|
|
|
|
struct GlobalLobbyRoom;
|
|
|
|
class CListBox;
|
2023-12-27 19:07:49 +02:00
|
|
|
|
|
|
|
class GlobalLobbyWidget : public InterfaceObjectConfigurable
|
|
|
|
{
|
|
|
|
GlobalLobbyWindow * window;
|
2024-01-11 22:51:36 +02:00
|
|
|
|
2024-03-13 23:02:53 +02:00
|
|
|
using CreateFunc = std::function<std::shared_ptr<CIntObject>(size_t)>;
|
|
|
|
|
|
|
|
std::shared_ptr<CIntObject> buildItemList(const JsonNode &) const;
|
|
|
|
CreateFunc getItemListConstructorFunc(const std::string & callbackName) const;
|
2024-01-21 16:48:36 +02:00
|
|
|
|
2023-12-27 19:07:49 +02:00
|
|
|
public:
|
2024-02-02 02:36:57 +02:00
|
|
|
explicit GlobalLobbyWidget(GlobalLobbyWindow * window);
|
2023-12-27 19:07:49 +02:00
|
|
|
|
|
|
|
std::shared_ptr<CLabel> getAccountNameLabel();
|
|
|
|
std::shared_ptr<CTextInput> getMessageInput();
|
|
|
|
std::shared_ptr<CTextBox> getGameChat();
|
2024-01-21 16:48:36 +02:00
|
|
|
std::shared_ptr<CListBox> getAccountList();
|
|
|
|
std::shared_ptr<CListBox> getRoomList();
|
2024-03-13 23:02:53 +02:00
|
|
|
std::shared_ptr<CListBox> getChannelList();
|
|
|
|
std::shared_ptr<CListBox> getMatchList();
|
2024-01-21 16:48:36 +02:00
|
|
|
};
|
|
|
|
|
2024-03-13 23:02:53 +02:00
|
|
|
class GlobalLobbyChannelCardBase : public CIntObject
|
2024-01-21 16:48:36 +02:00
|
|
|
{
|
2024-03-13 23:02:53 +02:00
|
|
|
GlobalLobbyWindow * window;
|
|
|
|
std::string channelType;
|
|
|
|
std::string channelName;
|
|
|
|
|
|
|
|
void clickPressed(const Point & cursorPosition) override;
|
2024-01-21 16:48:36 +02:00
|
|
|
public:
|
2024-03-13 23:02:53 +02:00
|
|
|
GlobalLobbyChannelCardBase(GlobalLobbyWindow * window, const std::string & channelType, const std::string & channelName);
|
|
|
|
};
|
2024-01-21 16:48:36 +02:00
|
|
|
|
2024-03-13 23:02:53 +02:00
|
|
|
class GlobalLobbyAccountCard : public GlobalLobbyChannelCardBase
|
|
|
|
{
|
2024-01-21 16:48:36 +02:00
|
|
|
std::shared_ptr<TransparentFilledRectangle> backgroundOverlay;
|
|
|
|
std::shared_ptr<CLabel> labelName;
|
|
|
|
std::shared_ptr<CLabel> labelStatus;
|
|
|
|
std::shared_ptr<CButton> buttonInvite;
|
2024-03-13 23:02:53 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
GlobalLobbyAccountCard(GlobalLobbyWindow * window, const GlobalLobbyAccount & accountDescription);
|
2024-01-21 16:48:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class GlobalLobbyRoomCard : public CIntObject
|
|
|
|
{
|
|
|
|
std::shared_ptr<TransparentFilledRectangle> backgroundOverlay;
|
|
|
|
std::shared_ptr<CLabel> labelName;
|
|
|
|
std::shared_ptr<CLabel> labelRoomSize;
|
2024-03-12 19:52:42 +02:00
|
|
|
std::shared_ptr<CLabel> labelRoomStatus;
|
2024-03-11 19:47:35 +02:00
|
|
|
std::shared_ptr<CLabel> labelDescription;
|
2024-01-21 16:48:36 +02:00
|
|
|
std::shared_ptr<CButton> buttonJoin;
|
2024-03-11 17:52:33 +02:00
|
|
|
std::shared_ptr<CPicture> iconRoomSize;
|
2024-03-13 23:02:53 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
GlobalLobbyRoomCard(GlobalLobbyWindow * window, const GlobalLobbyRoom & roomDescription);
|
|
|
|
};
|
|
|
|
|
|
|
|
class GlobalLobbyChannelCard : public GlobalLobbyChannelCardBase
|
|
|
|
{
|
|
|
|
std::shared_ptr<TransparentFilledRectangle> backgroundOverlay;
|
|
|
|
std::shared_ptr<CLabel> labelName;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GlobalLobbyChannelCard(GlobalLobbyWindow * window, const std::string & channelName);
|
|
|
|
};
|
|
|
|
|
|
|
|
class GlobalLobbyMatchCard : public GlobalLobbyChannelCardBase
|
|
|
|
{
|
|
|
|
std::shared_ptr<TransparentFilledRectangle> backgroundOverlay;
|
|
|
|
std::shared_ptr<CLabel> labelMatchDate;
|
|
|
|
std::shared_ptr<CLabel> labelMatchOpponent;
|
|
|
|
|
|
|
|
public:
|
2024-03-20 18:40:37 +02:00
|
|
|
GlobalLobbyMatchCard(GlobalLobbyWindow * window, const GlobalLobbyRoom & matchDescription);
|
2023-12-27 19:07:49 +02:00
|
|
|
};
|