1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/client/windows/CWindowWithArtifacts.h

49 lines
2.1 KiB
C++
Raw Normal View History

2023-04-23 14:10:35 +02:00
/*
* CWindowWithArtifacts.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
2024-04-23 15:21:45 +02:00
#include "../widgets/CArtifactsOfHeroMain.h"
#include "../widgets/CArtifactsOfHeroKingdom.h"
#include "../widgets/CArtifactsOfHeroAltar.h"
#include "../widgets/CArtifactsOfHeroMarket.h"
#include "../widgets/CArtifactsOfHeroBackpack.h"
#include "CWindowObject.h"
2023-04-23 14:10:35 +02:00
2024-04-23 15:21:45 +02:00
class CWindowWithArtifacts : virtual public CWindowObject
2023-04-23 14:10:35 +02:00
{
public:
using CArtifactsOfHeroPtr = std::shared_ptr<CArtifactsOfHeroBase>;
2023-04-23 14:10:35 +02:00
std::vector<CArtifactsOfHeroPtr> artSets;
2024-04-23 19:26:21 +02:00
explicit CWindowWithArtifacts(const std::vector<CArtifactsOfHeroPtr> * artSets = nullptr);
void addSet(const std::shared_ptr<CArtifactsOfHeroBase> & newArtSet);
2024-05-20 14:31:07 +02:00
const CGHeroInstance * getHeroPickedArtifact() const;
const CArtifactInstance * getPickedArtifact() const;
void clickPressedOnArtPlace(const CGHeroInstance * hero, const ArtifactPosition & slot,
2024-05-02 00:49:17 +02:00
bool allowExchange, bool altarTrading, bool closeWindow);
2024-05-20 14:31:07 +02:00
void swapArtifactAndClose(const CArtifactsOfHeroBase & artsInst, const ArtifactPosition & slot, const ArtifactLocation & dstLoc);
2024-05-08 13:16:16 +02:00
void showArtifactAssembling(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace, const Point & cursorPosition) const;
2024-05-20 14:31:07 +02:00
void showArifactInfo(const CArtifactsOfHeroBase & artsInst, CArtPlace & artPlace, const Point & cursorPosition) const;
void showQuickBackpackWindow(const CGHeroInstance * hero, const ArtifactPosition & slot, const Point & cursorPosition) const;
2024-04-23 15:21:45 +02:00
void activate() override;
void deactivate() override;
void enableKeyboardShortcuts() const;
2023-04-23 14:10:35 +02:00
2024-05-08 13:16:16 +02:00
virtual void update();
2023-04-23 14:10:35 +02:00
2023-09-18 21:58:08 +02:00
protected:
2024-05-20 14:31:07 +02:00
void markPossibleSlots() const;
2024-05-02 00:49:17 +02:00
bool checkSpecialArts(const CArtifactInstance & artInst, const CGHeroInstance & hero, bool isTrade) const;
2024-05-20 14:31:07 +02:00
void setCursorAnimation(const CArtifactInstance & artInst) const;
void putPickedArtifact(const CGHeroInstance & curHero, const ArtifactPosition & targetSlot) const;
2024-05-08 13:16:16 +02:00
void onClickPressedCommonArtifact(const CGHeroInstance & curHero, const ArtifactPosition & slot, bool closeWindow);
2023-04-23 14:10:35 +02:00
};