/* * 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 SelectionTab; class InfoCard; class CChatBox; class CLabel; class CFlagBox; class CLabelGroup; 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(int 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 buttonStart; std::shared_ptr buttonBack; std::shared_ptr tabSel; std::shared_ptr tabOpt; 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 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 labelGroupPlayersAssigned; std::shared_ptr labelGroupPlayersUnassigned; 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; CChatBox(const Rect & rect); void keyPressed(EShortcut key) override; void addNewMessage(const std::string & text); }; class CFlagBox : public CIntObject { std::shared_ptr iconsTeamFlags; 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(std::shared_ptr icons); }; }; extern ISelectionScreenInfo * SEL;