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

Components of combined artifacts will now display info about entire set.

This commit is contained in:
DjWarmonger 2013-12-01 13:08:35 +00:00
parent 36a69aaa2f
commit 21c18e44a0

View File

@ -4467,6 +4467,27 @@ void CArtPlace::setArtifact(const CArtifactInstance *art)
type = art->artType->iconIndex;
bonusValue = 0;
}
if (art->artType->constituents) //display info about components of combined artifact
{
//TODO
}
else if (art->artType->constituentOf.size()) //display info about set
{
std::string artList;
auto combinedArt = art->artType->constituentOf[0];
text += "\n\n";
text += "{" + combinedArt->Name() + "}";
int wornArtifacts = 0;
for (auto a : *combinedArt->constituents) //TODO: can the artifact be a part of more than one set?
{
artList += "\n" + a->Name();
if (ourOwner->curHero->hasArt(a->id, true))
wornArtifacts++;
}
text += " (" + boost::str(boost::format("%d") % wornArtifacts) + " / " +
boost::str(boost::format("%d") % combinedArt->constituents->size()) + ")" + artList;
//TODO: fancy colors and fonts for this text
}
if (locked) // Locks should appear as empty.
hoverText = CGI->generaltexth->allTexts[507];