mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Implemented optional descriptions for market map objects
It is now possible to define description of an object with 'market' handler that will be shown on right-clicking the object. Similarly, added description to right-click popup to Hill Fort.
This commit is contained in:
@ -1333,6 +1333,22 @@ void HillFort::fillUpgradeInfo(UpgradeInfo & info, const CStackInstance &stack)
|
||||
}
|
||||
}
|
||||
|
||||
std::string HillFort::getPopupText(PlayerColor player) const
|
||||
{
|
||||
MetaString message = MetaString::createFromRawString("{%s}\r\n\r\n%s");
|
||||
|
||||
message.replaceName(ID);
|
||||
message.replaceTextID(getDescriptionToolTip());
|
||||
|
||||
return message.toString();
|
||||
}
|
||||
|
||||
std::string HillFort::getPopupText(const CGHeroInstance * hero) const
|
||||
{
|
||||
return getPopupText(hero->getOwner());
|
||||
}
|
||||
|
||||
|
||||
std::string HillFort::getDescriptionToolTip() const
|
||||
{
|
||||
return TextIdentifier(getObjectHandler()->getBaseTextID(), "description").get();
|
||||
|
Reference in New Issue
Block a user