/* * CSelectionBase.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 "../mainmenu/CMainMenu.h" VCMI_LIB_NAMESPACE_BEGIN class CMapInfo; struct StartInfo; struct PlayerInfo; VCMI_LIB_NAMESPACE_END class CButton; class CTextBox; class CTextInput; class CAnimImage; class CToggleGroup; class RandomMapTab; class OptionsTab; class TurnOptionsTab; class ExtraOptionsTab; class SelectionTab; class InfoCard; class CChatBox; class PvPBox; class TownSelector; class CLabel; class CSlider; class CFlagBox; class CLabelGroup; class TransparentFilledRectangle; class FilledTexturePlayerColored; class LRClickableArea; class ISelectionScreenInfo { public: ESelectionScreen screenType; ISelectionScreenInfo(ESelectionScreen ScreenType = ESelectionScreen::unknown); virtual ~ISelectionScreenInfo(); virtual const CMapInfo * getMapInfo() = 0; virtual const StartInfo * getStartInfo() = 0; virtual int getCurrentDifficulty(); virtual PlayerInfo getPlayerInfo(PlayerColor color); }; /// The actual map selection screen which consists of the options and selection tab class CSelectionBase : public CWindowObject, public ISelectionScreenInfo { public: std::shared_ptr card; std::shared_ptr buttonSelect; std::shared_ptr buttonRMG; std::shared_ptr buttonOptions; std::shared_ptr buttonTurnOptions; std::shared_ptr buttonExtraOptions; std::shared_ptr buttonStart; std::shared_ptr buttonBack; std::shared_ptr buttonSimturns; std::shared_ptr tabSel; std::shared_ptr tabOpt; std::shared_ptr tabTurnOptions; std::shared_ptr tabExtraOptions; std::shared_ptr tabRand; std::shared_ptr curTab; CSelectionBase(ESelectionScreen type); virtual void toggleTab(std::shared_ptr tab); }; class InfoCard : public CIntObject { std::shared_ptr playerListBg; std::shared_ptr background; std::shared_ptr iconsVictoryCondition; std::shared_ptr iconsLossCondition; std::shared_ptr iconsMapSizes; std::shared_ptr labelSaveDate; std::shared_ptr labelMapSize; std::shared_ptr labelScenarioName; std::shared_ptr labelScenarioDescription; std::shared_ptr labelVictoryCondition; std::shared_ptr labelLossCondition; std::shared_ptr labelMapDiff; std::shared_ptr labelPlayerDifficulty; std::shared_ptr labelRating; std::shared_ptr labelCampaignDescription; std::shared_ptr mapName; std::shared_ptr mapDescription; std::shared_ptr labelDifficulty; std::shared_ptr labelDifficultyPercent; std::shared_ptr labelVictoryConditionText; std::shared_ptr labelLossConditionText; std::shared_ptr labelGroupPlayers; std::shared_ptr buttonInvitePlayers; std::shared_ptr buttonOpenGlobalLobby; std::shared_ptr pvpBox; public: bool showChat; std::shared_ptr chat; std::shared_ptr flagbox; std::shared_ptr iconDifficulty; InfoCard(); void disableLabelRedraws(); void changeSelection(); void toggleChat(); void setChat(bool activateChat); }; class CChatBox : public CIntObject { public: std::shared_ptr chatHistory; std::shared_ptr inputBox; std::shared_ptr inputBackground; CChatBox(const Rect & rect); void keyPressed(EShortcut key) override; bool captureThisKey(EShortcut key) override; void addNewMessage(const std::string & text); }; class PvPBox : public CIntObject { std::shared_ptr backgroundTexture; std::shared_ptr backgroundBorder; std::shared_ptr townSelector; std::shared_ptr buttonFlipCoin; std::shared_ptr buttonRandomTown; std::shared_ptr buttonRandomTownVs; std::shared_ptr buttonHandicap; public: PvPBox(const Rect & rect); }; class TownSelector : public CIntObject { std::map> towns; std::map> townsArea; std::shared_ptr slider; void sliderMove(int slidPos); void updateListItems(); public: std::map townsEnabled; TownSelector(const Point & loc); }; class CFlagBox : public CIntObject { std::shared_ptr labelAllies; std::shared_ptr labelEnemies; std::vector> flagsAllies; std::vector> flagsEnemies; public: CFlagBox(const Rect & rect); void recreate(); void showPopupWindow(const Point & cursorPosition) override; void showTeamsPopup(); class CFlagBoxTooltipBox : public CWindowObject { std::shared_ptr labelTeamAlignment; std::shared_ptr labelGroupTeams; std::vector> iconsFlags; public: CFlagBoxTooltipBox(); }; }; extern ISelectionScreenInfo * SEL;