mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Components of combined artifacts will now display info about entire set.
This commit is contained in:
parent
36a69aaa2f
commit
21c18e44a0
@ -4467,6 +4467,27 @@ void CArtPlace::setArtifact(const CArtifactInstance *art)
|
|||||||
type = art->artType->iconIndex;
|
type = art->artType->iconIndex;
|
||||||
bonusValue = 0;
|
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.
|
if (locked) // Locks should appear as empty.
|
||||||
hoverText = CGI->generaltexth->allTexts[507];
|
hoverText = CGI->generaltexth->allTexts[507];
|
||||||
|
Loading…
Reference in New Issue
Block a user