1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Improvements to rewardable objects popups

This commit is contained in:
Ivan Savenko
2023-10-16 23:55:37 +03:00
parent 850d0ff8eb
commit 927ce4e60e
7 changed files with 94 additions and 19 deletions

View File

@@ -37,6 +37,8 @@ protected:
virtual void grantRewardWithMessage(const CGHeroInstance * contextHero, int rewardIndex, bool markAsVisit) const;
virtual void selectRewardWthMessage(const CGHeroInstance * contextHero, const std::vector<ui32> & rewardIndices, const MetaString & dialog) const;
std::vector<Component> loadComponents(const CGHeroInstance * contextHero, const std::vector<ui32> & rewardIndices) const;
public:
/// Visitability checks. Note that hero check includes check for hero owner (returns true if object was visited by player)
bool wasVisited(PlayerColor player) const override;
@@ -66,6 +68,9 @@ public:
std::string getHoverText(PlayerColor player) const override;
std::string getHoverText(const CGHeroInstance * hero) const override;
std::vector<Component> getPopupComponents(PlayerColor player) const override;
std::vector<Component> getPopupComponents(const CGHeroInstance * hero) const override;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & static_cast<CArmedInstance&>(*this);