/* * CInfoBar.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/CIntObject.h" VCMI_LIB_NAMESPACE_BEGIN class CGHeroInstance; class CGTownInstance; struct Component; class PlayerColor; VCMI_LIB_NAMESPACE_END class CAnimImage; class CShowableAnim; class CComponent; class CHeroTooltip; class CTownTooltip; class CLabel; class CTextBox; /// Info box which shows next week/day information, hold the current date class CInfoBar : public CIntObject { //all visible information located in one object - for ease of replacing class CVisibleInfo : public CIntObject { public: void show(SDL_Surface * to) override; protected: std::shared_ptr background; std::list> forceRefresh; CVisibleInfo(); }; class EmptyVisibleInfo : public CVisibleInfo { public: EmptyVisibleInfo(); }; class VisibleHeroInfo : public CVisibleInfo { std::shared_ptr heroTooltip; public: VisibleHeroInfo(const CGHeroInstance * hero); }; class VisibleTownInfo : public CVisibleInfo { std::shared_ptr townTooltip; public: VisibleTownInfo(const CGTownInstance * town); }; class VisibleDateInfo : public CVisibleInfo { std::shared_ptr animation; std::shared_ptr label; std::string getNewDayName(); public: VisibleDateInfo(); }; class VisibleEnemyTurnInfo : public CVisibleInfo { std::shared_ptr banner; std::shared_ptr glass; std::shared_ptr sand; public: VisibleEnemyTurnInfo(PlayerColor player); }; class VisibleGameStatusInfo : public CVisibleInfo { std::shared_ptr allyLabel; std::shared_ptr enemyLabel; std::vector> flags; std::vector> hallIcons; std::vector> hallLabels; public: VisibleGameStatusInfo(); }; class VisibleComponentInfo : public CVisibleInfo { std::shared_ptr comp; std::shared_ptr text; public: VisibleComponentInfo(const Component & compToDisplay, std::string message); }; enum EState { EMPTY, HERO, TOWN, DATE, GAME, AITURN, COMPONENT }; std::shared_ptr visibleInfo; EState state; //removes all information about current state, deactivates timer (if any) void reset(); void tick() override; void clickLeft(tribool down, bool previousState) override; void clickRight(tribool down, bool previousState) override; void hover(bool on) override; void playNewDaySound(); public: CInfoBar(const Rect & pos); /// show new day/week animation void showDate(); /// show component for 3 seconds. Used to display picked up resources void showComponent(const Component & comp, std::string message); /// print enemy turn progress void startEnemyTurn(PlayerColor color); /// reset to default view - selected object void showSelection(); /// show hero\town information void showHeroSelection(const CGHeroInstance * hero); void showTownSelection(const CGTownInstance * town); /// for 3 seconds shows amount of town halls and players status void showGameStatus(); };