mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Add support for custom icons & descriptions for bonuses
This commit is contained in:
@@ -837,11 +837,20 @@ void CStackInstance::setCount(TQuantity newCount)
|
||||
|
||||
std::string CStackInstance::bonusToString(const std::shared_ptr<Bonus>& bonus, bool description) const
|
||||
{
|
||||
if (!bonus->description.empty())
|
||||
{
|
||||
if (description)
|
||||
return bonus->description.toString();
|
||||
else
|
||||
return {};
|
||||
}
|
||||
return LIBRARY->getBth()->bonusToString(bonus, this, description);
|
||||
}
|
||||
|
||||
ImagePath CStackInstance::bonusToGraphics(const std::shared_ptr<Bonus> & bonus) const
|
||||
{
|
||||
if (!bonus->customIconPath.empty())
|
||||
return bonus->customIconPath;
|
||||
return LIBRARY->getBth()->bonusToGraphics(bonus);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user