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

Show non-learnable spells from rewardable object as greyed-out

This commit is contained in:
Ivan Savenko
2024-07-27 18:09:12 +00:00
parent f9348fc84a
commit 74fea5109b
2 changed files with 8 additions and 2 deletions

View File

@@ -290,7 +290,10 @@ std::string CComponent::getSubtitle() const
return CGI->artifacts()->getById(data.subType.as<ArtifactID>())->getNameTranslated();
case ComponentType::SPELL_SCROLL:
case ComponentType::SPELL:
return CGI->spells()->getById(data.subType.as<SpellID>())->getNameTranslated();
if (data.value < 0)
return "{#A9A9A9|" + CGI->spells()->getById(data.subType.as<SpellID>())->getNameTranslated() + "}";
else
return CGI->spells()->getById(data.subType.as<SpellID>())->getNameTranslated();
case ComponentType::NONE:
case ComponentType::MORALE:
case ComponentType::LUCK: