mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix sonar warnings, convert spaces -> tabs
This commit is contained in:
@@ -19,72 +19,72 @@
|
||||
|
||||
std::vector<Component> UIHelper::getArtifactsComponents(const CArtifactSet & artSet, const std::vector<MoveArtifactInfo> & movedPack)
|
||||
{
|
||||
std::vector<Component> components;
|
||||
for(const auto & artMoveInfo : movedPack)
|
||||
{
|
||||
const auto art = artSet.getArt(artMoveInfo.dstPos);
|
||||
assert(art);
|
||||
std::vector<Component> components;
|
||||
for(const auto & artMoveInfo : movedPack)
|
||||
{
|
||||
const auto art = artSet.getArt(artMoveInfo.dstPos);
|
||||
assert(art);
|
||||
|
||||
if(art->isScroll())
|
||||
components.emplace_back(ComponentType::SPELL_SCROLL, art->getScrollSpellID());
|
||||
else
|
||||
components.emplace_back(ComponentType::ARTIFACT, art->getTypeId());
|
||||
}
|
||||
return components;
|
||||
if(art->isScroll())
|
||||
components.emplace_back(ComponentType::SPELL_SCROLL, art->getScrollSpellID());
|
||||
else
|
||||
components.emplace_back(ComponentType::ARTIFACT, art->getTypeId());
|
||||
}
|
||||
return components;
|
||||
}
|
||||
|
||||
std::vector<Component> UIHelper::getSpellsComponents(const std::set<SpellID> & spells)
|
||||
{
|
||||
std::vector<Component> components;
|
||||
for(const auto & spell : spells)
|
||||
components.emplace_back(ComponentType::SPELL, spell);
|
||||
return components;
|
||||
std::vector<Component> components;
|
||||
for(const auto & spell : spells)
|
||||
components.emplace_back(ComponentType::SPELL, spell);
|
||||
return components;
|
||||
}
|
||||
|
||||
soundBase::soundID UIHelper::getNecromancyInfoWindowSound()
|
||||
{
|
||||
return soundBase::soundID(soundBase::pickup01 + CRandomGenerator::getDefault().nextInt(6));
|
||||
return soundBase::soundID(soundBase::pickup01 + CRandomGenerator::getDefault().nextInt(6));
|
||||
}
|
||||
|
||||
std::string UIHelper::getNecromancyInfoWindowText(const CStackBasicDescriptor & stack)
|
||||
{
|
||||
MetaString text;
|
||||
if(stack.getCount() > 1) // Practicing the dark arts of necromancy, ... (plural)
|
||||
{
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 145);
|
||||
text.replaceNumber(stack.getCount());
|
||||
}
|
||||
else // Practicing the dark arts of necromancy, ... (singular)
|
||||
{
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 146);
|
||||
}
|
||||
text.replaceName(stack);
|
||||
return text.toString();
|
||||
MetaString text;
|
||||
if(stack.getCount() > 1) // Practicing the dark arts of necromancy, ... (plural)
|
||||
{
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 145);
|
||||
text.replaceNumber(stack.getCount());
|
||||
}
|
||||
else // Practicing the dark arts of necromancy, ... (singular)
|
||||
{
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 146);
|
||||
}
|
||||
text.replaceName(stack);
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
std::string UIHelper::getArtifactsInfoWindowText()
|
||||
{
|
||||
MetaString text;
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 30);
|
||||
return text.toString();
|
||||
MetaString text;
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 30);
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
std::string UIHelper::getEagleEyeInfoWindowText(const CGHeroInstance & hero, const std::set<SpellID> & spells)
|
||||
{
|
||||
MetaString text;
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 221); // Through eagle-eyed observation, %s is able to learn %s
|
||||
text.replaceRawString(hero.getNameTranslated());
|
||||
MetaString text;
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 221); // Through eagle-eyed observation, %s is able to learn %s
|
||||
text.replaceRawString(hero.getNameTranslated());
|
||||
|
||||
auto curSpell = spells.begin();
|
||||
text.replaceName(*curSpell++);
|
||||
for(int i = 1; i < spells.size(); i++, curSpell++)
|
||||
{
|
||||
if(i + 1 == spells.size())
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 141); // " and "
|
||||
else
|
||||
text.appendRawString(", ");
|
||||
text.appendName(*curSpell);
|
||||
}
|
||||
text.appendRawString(".");
|
||||
return text.toString();
|
||||
auto curSpell = spells.begin();
|
||||
text.replaceName(*curSpell++);
|
||||
for(int i = 1; i < spells.size(); i++, curSpell++)
|
||||
{
|
||||
if(i + 1 == spells.size())
|
||||
text.appendLocalString(EMetaText::GENERAL_TXT, 141); // " and "
|
||||
else
|
||||
text.appendRawString(", ");
|
||||
text.appendName(*curSpell);
|
||||
}
|
||||
text.appendRawString(".");
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user