2017-11-01 15:58:49 +02:00
|
|
|
/*
|
2017-12-21 20:27:39 +02:00
|
|
|
* CreaturePurchaseCard.h, part of VCMI engine
|
2017-11-01 15:58:49 +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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../widgets/Images.h"
|
|
|
|
|
|
|
|
class CCreaturePic;
|
|
|
|
class CSlider;
|
|
|
|
class CButton;
|
|
|
|
class CreatureCostBox;
|
|
|
|
class QuickRecruitmentWindow;
|
|
|
|
|
2017-12-20 21:08:21 +02:00
|
|
|
class CreaturePurchaseCard : public CIntObject
|
2017-11-01 15:58:49 +02:00
|
|
|
{
|
|
|
|
public:
|
2017-11-15 20:44:54 +02:00
|
|
|
const CCreature * creatureOnTheCard;
|
2017-11-01 15:58:49 +02:00
|
|
|
std::shared_ptr<CSlider> slider;
|
|
|
|
QuickRecruitmentWindow * parent;
|
2017-11-15 20:44:54 +02:00
|
|
|
int maxAmount;
|
2017-11-01 15:58:49 +02:00
|
|
|
void sliderMoved(int to);
|
2017-12-20 21:08:21 +02:00
|
|
|
CreaturePurchaseCard(const std::vector<CreatureID> & creaturesID, Point position, int creaturesMaxAmount, QuickRecruitmentWindow * parents);
|
2017-11-01 15:58:49 +02:00
|
|
|
private:
|
|
|
|
void initView();
|
|
|
|
|
|
|
|
void initButtons();
|
|
|
|
void initMaxButton();
|
|
|
|
void initMinButton();
|
2017-12-20 21:08:21 +02:00
|
|
|
void initCreatureSwitcherButton();
|
|
|
|
void switchCreatureLevel();
|
2017-11-01 15:58:49 +02:00
|
|
|
|
|
|
|
void initAmountInfo();
|
|
|
|
void updateAmountInfo(int value);
|
|
|
|
|
|
|
|
void initSlider();
|
|
|
|
|
|
|
|
void initCostBox();
|
|
|
|
|
2017-12-20 21:08:21 +02:00
|
|
|
std::shared_ptr<CButton> maxButton, minButton, creatureSwitcher;
|
2017-11-01 15:58:49 +02:00
|
|
|
std::shared_ptr<CLabel> availableAmount, purhaseAmount;
|
|
|
|
std::shared_ptr<CCreaturePic> picture;
|
|
|
|
std::shared_ptr<CreatureCostBox> cost;
|
2017-12-21 20:27:39 +02:00
|
|
|
std::vector<CreatureID> upgradesID;
|
2017-11-01 15:58:49 +02:00
|
|
|
};
|