2017-07-13 11:26:03 +03:00
|
|
|
/*
|
2023-02-01 16:42:03 +02:00
|
|
|
* CResDataBar.h, part of VCMI engine
|
2017-07-13 11:26:03 +03:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
2011-12-13 21:23:17 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
#include "../gui/CIntObject.h"
|
2015-02-02 15:02:27 +03:00
|
|
|
|
2023-04-26 18:12:18 +03:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
2023-04-26 15:44:10 +03:00
|
|
|
enum class EGameResID : int8_t;
|
|
|
|
using GameResID = Identifier<EGameResID>;
|
2023-04-26 18:12:18 +03:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
2023-04-26 15:44:10 +03:00
|
|
|
|
2011-02-22 11:52:36 +00:00
|
|
|
/// Resources bar which shows information about how many gold, crystals,... you have
|
|
|
|
/// Current date is displayed too
|
2012-06-13 13:04:06 +00:00
|
|
|
class CResDataBar : public CIntObject
|
2008-12-27 01:01:59 +00:00
|
|
|
{
|
2023-02-03 18:55:25 +02:00
|
|
|
std::string buildDateString();
|
|
|
|
|
2018-04-07 14:34:11 +03:00
|
|
|
std::shared_ptr<CPicture> background;
|
|
|
|
|
2023-04-26 15:44:10 +03:00
|
|
|
std::map<GameResID, Point> resourcePositions;
|
|
|
|
std::optional<Point> datePosition;
|
2023-02-10 23:29:13 +02:00
|
|
|
|
|
|
|
public:
|
2023-04-26 15:44:10 +03:00
|
|
|
|
|
|
|
/// For dynamically-sized UI windows, e.g. adventure map interface
|
|
|
|
CResDataBar(const std::string & imageName, const Point & position);
|
|
|
|
|
|
|
|
/// For fixed-size UI windows, e.g. CastleInterface
|
2008-12-27 01:01:59 +00:00
|
|
|
CResDataBar(const std::string &defname, int x, int y, int offx, int offy, int resdist, int datedist);
|
|
|
|
|
2023-04-26 15:44:10 +03:00
|
|
|
void setDatePosition(const Point & position);
|
|
|
|
void setResourcePosition(const GameResID & resource, const Point & position);
|
|
|
|
|
2023-02-10 23:29:13 +02:00
|
|
|
void colorize(PlayerColor player);
|
2023-06-02 16:42:18 +03:00
|
|
|
void showAll(Canvas & to) override;
|
2008-12-27 01:01:59 +00:00
|
|
|
};
|
2011-02-22 11:52:36 +00:00
|
|
|
|