1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00
vcmi/client/windows/CExchangeWindow.h
2024-06-11 19:22:23 +00:00

81 lines
2.8 KiB
C++

/*
* CExchangeWindow.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 "CWindowWithArtifacts.h"
#include "../widgets/CExchangeController.h"
class CGarrisonSlot;
class CExchangeWindow : public CStatusbarWindow, public IGarrisonHolder, public CWindowWithArtifacts
{
std::array<std::shared_ptr<CLabel>, 2> titles;
std::vector<std::shared_ptr<CAnimImage>> primSkillImages;//shared for both heroes
std::array<std::vector<std::shared_ptr<CLabel>>, 2> primSkillValues;
std::array<std::vector<std::shared_ptr<CAnimImage>>, 2> secSkillIcons;
std::array<std::shared_ptr<CAnimImage>, 2> specImages;
std::array<std::shared_ptr<CAnimImage>, 2> expImages;
std::array<std::shared_ptr<CLabel>, 2> expValues;
std::array<std::shared_ptr<CAnimImage>, 2> manaImages;
std::array<std::shared_ptr<CLabel>, 2> manaValues;
std::vector<std::shared_ptr<LRClickableAreaWTextComp>> primSkillAreas;
std::array<std::vector<std::shared_ptr<LRClickableAreaWTextComp>>, 2> secSkillAreas;
std::array<std::shared_ptr<CHeroArea>, 2> heroAreas;
std::array<std::shared_ptr<LRClickableAreaWText>, 2> specialtyAreas;
std::array<std::shared_ptr<LRClickableAreaWText>, 2> experienceAreas;
std::array<std::shared_ptr<LRClickableAreaWText>, 2> spellPointsAreas;
std::array<std::shared_ptr<MoraleLuckBox>, 2> morale;
std::array<std::shared_ptr<MoraleLuckBox>, 2> luck;
std::shared_ptr<CButton> quit;
std::array<std::shared_ptr<CButton>, 2> questlogButton;
std::shared_ptr<CGarrisonInt> garr;
std::shared_ptr<CButton> buttonMoveUnitsFromLeftToRight;
std::shared_ptr<CButton> buttonMoveUnitsFromRightToLeft;
std::shared_ptr<CButton> buttonMoveArtifactsFromLeftToRight;
std::shared_ptr<CButton> buttonMoveArtifactsFromRightToLeft;
std::shared_ptr<CButton> exchangeUnitsButton;
std::shared_ptr<CButton> exchangeArtifactsButton;
std::vector<std::shared_ptr<CButton>> moveUnitFromLeftToRightButtons;
std::vector<std::shared_ptr<CButton>> moveUnitFromRightToLeftButtons;
std::shared_ptr<CButton> backpackButtonLeft;
std::shared_ptr<CButton> backpackButtonRight;
CExchangeController controller;
void moveArtifactsCallback(bool leftToRight);
void swapArtifactsCallback();
void moveUnitsShortcut(bool leftToRight);
void backpackShortcut(bool leftHero);
void questLogShortcut();
std::array<const CGHeroInstance *, 2> heroInst;
std::array<std::shared_ptr<CArtifactsOfHeroMain>, 2> artifs;
const CGarrisonSlot * getSelectedSlotID() const;
public:
CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2, QueryID queryID);
void keyPressed(EShortcut key) override;
void update() override;
// IGarrisonHolder impl
void updateGarrisons() override;
bool holdsGarrison(const CArmedInstance * army) override;
};