mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Show non-learnable spells from rewardable object as greyed-out
This commit is contained in:
parent
f9348fc84a
commit
74fea5109b
@ -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:
|
||||
|
@ -115,7 +115,10 @@ void Rewardable::Reward::loadComponents(std::vector<Component> & comps, const CG
|
||||
comps.emplace_back(ComponentType::ARTIFACT, entry);
|
||||
|
||||
for(const auto & entry : spells)
|
||||
comps.emplace_back(ComponentType::SPELL, entry);
|
||||
{
|
||||
bool learnable = !h || h->canLearnSpell(entry.toEntity(VLC), true);
|
||||
comps.emplace_back(ComponentType::SPELL, entry, learnable ? 0 : -1);
|
||||
}
|
||||
|
||||
for(const auto & entry : creatures)
|
||||
comps.emplace_back(ComponentType::CREATURE, entry.type->getId(), entry.count);
|
||||
|
Loading…
Reference in New Issue
Block a user