mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Adding object construction macro with parameter
- Adding macro "OBJECT_CONSTRUCTION_CAPTURING" that take as parameter action flag. - Fixed minor errors
This commit is contained in:
@@ -14,9 +14,10 @@
|
|||||||
|
|
||||||
class CreatureCostBox : public CIntObject
|
class CreatureCostBox : public CIntObject
|
||||||
{
|
{
|
||||||
std::map<int, std::pair<CLabel *, CAnimImage * > > resources;
|
|
||||||
public:
|
public:
|
||||||
void set(TResources res);
|
void set(TResources res);
|
||||||
CreatureCostBox(Rect position, std::string title);
|
CreatureCostBox(Rect position, std::string title);
|
||||||
void createItems(TResources res);
|
void createItems(TResources res);
|
||||||
|
private:
|
||||||
|
std::map<int, std::pair<CLabel *, CAnimImage * > > resources;
|
||||||
};
|
};
|
||||||
|
@@ -140,6 +140,7 @@ struct SSetCaptureState
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this)
|
#define OBJ_CONSTRUCTION SObjectConstruction obj__i(this)
|
||||||
|
#define OBJECT_CONSTRUCTION_CAPTURING(actions) defActions = actions; SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this)
|
||||||
#define OBJ_CONSTRUCTION_CAPTURING_ALL defActions = 255; SSetCaptureState obj__i1(true, 255); SObjectConstruction obj__i(this)
|
#define OBJ_CONSTRUCTION_CAPTURING_ALL defActions = 255; SSetCaptureState obj__i1(true, 255); SObjectConstruction obj__i(this)
|
||||||
#define BLOCK_CAPTURING SSetCaptureState obj__i(false, 0)
|
#define BLOCK_CAPTURING SSetCaptureState obj__i(false, 0)
|
||||||
#define BLOCK_CAPTURING_DONT_TOUCH_REC_ACTIONS SSetCaptureState obj__i(false, GH.defActionsDef)
|
#define BLOCK_CAPTURING_DONT_TOUCH_REC_ACTIONS SSetCaptureState obj__i(false, GH.defActionsDef)
|
||||||
|
@@ -996,7 +996,7 @@ void CCastleInterface::recreateIcons()
|
|||||||
|
|
||||||
hall = new CTownInfo( 80, 413, town, true);
|
hall = new CTownInfo( 80, 413, town, true);
|
||||||
fort = new CTownInfo(122, 413, town, false);
|
fort = new CTownInfo(122, 413, town, false);
|
||||||
fastArmyPurhase = std::make_shared<CButton>(Point(122, 413), "itmcl.def", CButton::tooltip("quick army purhase"), [&](){builds->enterToTheQuickRecruitmentWindow();});
|
fastArmyPurhase = new CButton(Point(122, 413), "itmcl.def", CButton::tooltip("quick army purhase"), [&](){builds->enterToTheQuickRecruitmentWindow();});
|
||||||
fastArmyPurhase->setImageOrder(town->fortLevel()-1,town->fortLevel()-1,town->fortLevel()-1,town->fortLevel()-1);
|
fastArmyPurhase->setImageOrder(town->fortLevel()-1,town->fortLevel()-1,town->fortLevel()-1,town->fortLevel()-1);
|
||||||
for (auto & elem : creainfo)
|
for (auto & elem : creainfo)
|
||||||
delete elem;
|
delete elem;
|
||||||
|
@@ -205,7 +205,7 @@ class CCastleInterface : public CWindowObject, public CWindowWithGarrison
|
|||||||
|
|
||||||
CButton *exit;
|
CButton *exit;
|
||||||
CButton *split;
|
CButton *split;
|
||||||
std::shared_ptr<CButton> fastArmyPurhase;
|
CButton * fastArmyPurhase;
|
||||||
|
|
||||||
std::vector<CCreaInfo*> creainfo;//small icons of creatures (bottom-left corner);
|
std::vector<CCreaInfo*> creainfo;//small icons of creatures (bottom-left corner);
|
||||||
|
|
||||||
|
@@ -149,7 +149,8 @@ void QuickRecruitmentWindow::updateAllSliders()
|
|||||||
|
|
||||||
QuickRecruitmentWindow::QuickRecruitmentWindow(const CGTownInstance * townd) : CWindowObject(PLAYER_COLORED | BORDERED), town(townd)
|
QuickRecruitmentWindow::QuickRecruitmentWindow(const CGTownInstance * townd) : CWindowObject(PLAYER_COLORED | BORDERED), town(townd)
|
||||||
{
|
{
|
||||||
OBJ_CONSTRUCTION_CAPTURING_ALL;
|
OBJECT_CONSTRUCTION_CAPTURING(ACTIVATE + DEACTIVATE + UPDATE + SHOWALL);
|
||||||
|
|
||||||
initWindow();
|
initWindow();
|
||||||
setButtons();
|
setButtons();
|
||||||
setCreaturePurhaseCards();
|
setCreaturePurhaseCards();
|
||||||
|
@@ -36,6 +36,7 @@ private:
|
|||||||
void maxAllCards(std::vector<std::shared_ptr<CreaturePurhaseCard>> cards);
|
void maxAllCards(std::vector<std::shared_ptr<CreaturePurhaseCard>> cards);
|
||||||
void maxAllSlidersAmount(std::vector<std::shared_ptr<CreaturePurhaseCard>> cards);
|
void maxAllSlidersAmount(std::vector<std::shared_ptr<CreaturePurhaseCard>> cards);
|
||||||
void purhaseUnits();
|
void purhaseUnits();
|
||||||
|
|
||||||
const CGTownInstance * town;
|
const CGTownInstance * town;
|
||||||
std::shared_ptr<CButton> maxButton, buyButton, cancelButton;
|
std::shared_ptr<CButton> maxButton, buyButton, cancelButton;
|
||||||
std::shared_ptr<CreatureCostBox> totalCost;
|
std::shared_ptr<CreatureCostBox> totalCost;
|
||||||
|
Reference in New Issue
Block a user