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