/* * CAdvMapPanel.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 PlayerColor; VCMI_LIB_NAMESPACE_END class CAnimation; class CAnimImage; class CFilledTexture; class CButton; class IImage; /// simple panel that contains other displayable elements; used to separate groups of controls class CAdvMapPanel : public CIntObject { std::vector> colorableButtons; std::vector> otherObjects; /// the surface passed to this obj will be freed in dtor std::shared_ptr background; public: CAdvMapPanel(std::shared_ptr bg, Point position); void addChildToPanel(std::shared_ptr obj, ui8 actions = 0); void addChildColorableButton(std::shared_ptr button); /// recolors all buttons to given player color void setPlayerColor(const PlayerColor & clr); void showAll(SDL_Surface * to) override; }; /// specialized version of CAdvMapPanel that handles recolorable def-based pictures for world view info panel class CAdvMapWorldViewPanel : public CAdvMapPanel { /// data that allows reconstruction of panel info icons std::vector> iconsData; /// ptrs to child-pictures constructed from iconsData std::vector> currentIcons; /// surface drawn below world view panel on higher resolutions (won't be needed when world view panel is configured for extraResolutions mod) std::shared_ptr backgroundFiller; std::shared_ptr icons; public: CAdvMapWorldViewPanel(std::shared_ptr _icons, std::shared_ptr bg, Point position, int spaceBottom, const PlayerColor &color); void addChildIcon(std::pair data, int indexOffset); /// recreates all pictures from given def to recolor them according to current player color void recolorIcons(const PlayerColor & color, int indexOffset); };