mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Remove some usages of server-side translations
This commit is contained in:
parent
7a42e21e4d
commit
18ece6dcf6
@ -217,7 +217,6 @@ public:
|
||||
void setObjPropertyID(ObjectInstanceID objid, ObjProperty prop, ObjPropertyID identifier) override {};
|
||||
|
||||
void showInfoDialog(InfoWindow * iw) override {};
|
||||
void showInfoDialog(const std::string & msg, PlayerColor player) override {};
|
||||
void removeGUI() const;
|
||||
|
||||
#if SCRIPTING_ENABLED
|
||||
|
@ -78,7 +78,6 @@ public:
|
||||
virtual void setObjPropertyID(ObjectInstanceID objid, ObjProperty prop, ObjPropertyID identifier) = 0;
|
||||
|
||||
virtual void showInfoDialog(InfoWindow * iw) = 0;
|
||||
virtual void showInfoDialog(const std::string & msg, PlayerColor player) = 0;
|
||||
|
||||
virtual void changeSpells(const CGHeroInstance * hero, bool give, const std::set<SpellID> &spells)=0;
|
||||
virtual bool removeObject(const CGObjectInstance * obj, const PlayerColor & initiator) = 0;
|
||||
|
@ -130,10 +130,7 @@ std::string Bonus::Description(std::optional<si32> customValue) const
|
||||
auto valueToShow = customValue.value_or(val);
|
||||
|
||||
if(valueToShow != 0)
|
||||
{
|
||||
descriptionHelper.replaceNumber(valueToShow);
|
||||
descriptionHelper.replacePositiveNumber(valueToShow);
|
||||
}
|
||||
|
||||
return descriptionHelper.toString();
|
||||
}
|
||||
|
@ -144,6 +144,9 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string getBiographyTranslated() const;
|
||||
std::string getBiographyTextID() const;
|
||||
|
||||
std::string getNameTextID() const;
|
||||
std::string getNameTranslated() const;
|
||||
|
||||
HeroTypeID getPortraitSource() const;
|
||||
@ -152,9 +155,6 @@ public:
|
||||
std::string getClassNameTranslated() const;
|
||||
std::string getClassNameTextID() const;
|
||||
|
||||
private:
|
||||
std::string getNameTextID() const;
|
||||
std::string getBiographyTextID() const;
|
||||
public:
|
||||
|
||||
bool hasSpellbook() const;
|
||||
|
@ -388,7 +388,7 @@ void CGameHandler::giveExperience(const CGHeroInstance * hero, TExpType amountTo
|
||||
InfoWindow iw;
|
||||
iw.player = hero->tempOwner;
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 1); //can gain no more XP
|
||||
iw.text.replaceRawString(hero->getNameTranslated());
|
||||
iw.text.replaceTextID(hero->getNameTextID());
|
||||
sendAndApply(&iw);
|
||||
}
|
||||
|
||||
@ -1593,7 +1593,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
|
||||
iw.components.emplace_back(ComponentType::SEC_SKILL, scholarSkill, scholarSkillLevel);
|
||||
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 139);//"%s, who has studied magic extensively,
|
||||
iw.text.replaceRawString(h1->getNameTranslated());
|
||||
iw.text.replaceTextID(h1->getNameTextID());
|
||||
|
||||
if (!cs2.spells.empty())//if found new spell - apply
|
||||
{
|
||||
@ -1614,7 +1614,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
|
||||
}
|
||||
}
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 142);//from %s
|
||||
iw.text.replaceRawString(h2->getNameTranslated());
|
||||
iw.text.replaceTextID(h2->getNameTextID());
|
||||
sendAndApply(&cs2);
|
||||
}
|
||||
|
||||
@ -1642,7 +1642,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
|
||||
}
|
||||
}
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 148);//from %s
|
||||
iw.text.replaceRawString(h2->getNameTranslated());
|
||||
iw.text.replaceTextID(h2->getNameTextID());
|
||||
sendAndApply(&cs1);
|
||||
}
|
||||
sendAndApply(&iw);
|
||||
@ -4265,14 +4265,6 @@ void CGameHandler::showInfoDialog(InfoWindow * iw)
|
||||
sendAndApply(iw);
|
||||
}
|
||||
|
||||
void CGameHandler::showInfoDialog(const std::string & msg, PlayerColor player)
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.player = player;
|
||||
iw.text.appendRawString(msg);
|
||||
showInfoDialog(&iw);
|
||||
}
|
||||
|
||||
CRandomGenerator & CGameHandler::getRandomGenerator()
|
||||
{
|
||||
return CRandomGenerator::getDefault();
|
||||
|
@ -160,7 +160,6 @@ public:
|
||||
void setObjPropertyValue(ObjectInstanceID objid, ObjProperty prop, int32_t value) override;
|
||||
void setObjPropertyID(ObjectInstanceID objid, ObjProperty prop, ObjPropertyID identifier) override;
|
||||
void showInfoDialog(InfoWindow * iw) override;
|
||||
void showInfoDialog(const std::string & msg, PlayerColor player) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void useScholarSkill(ObjectInstanceID hero1, ObjectInstanceID hero2);
|
||||
|
@ -1523,26 +1523,27 @@ void BattleActionProcessor::addGenericKilledLog(BattleLogMessage & blm, const CS
|
||||
{
|
||||
if(killed > 0)
|
||||
{
|
||||
const int32_t txtIndex = (killed > 1) ? 379 : 378;
|
||||
std::string formatString = VLC->generaltexth->allTexts[txtIndex];
|
||||
|
||||
// these default h3 texts have unnecessary new lines, so get rid of them before displaying (and trim just in case, trimming newlines does not works for some reason)
|
||||
formatString.erase(std::remove(formatString.begin(), formatString.end(), '\n'), formatString.end());
|
||||
formatString.erase(std::remove(formatString.begin(), formatString.end(), '\r'), formatString.end());
|
||||
boost::algorithm::trim(formatString);
|
||||
|
||||
boost::format txt(formatString);
|
||||
if(killed > 1)
|
||||
{
|
||||
txt % killed % (multiple ? VLC->generaltexth->allTexts[43] : defender->unitType()->getNamePluralTranslated()); // creatures perish
|
||||
}
|
||||
else //killed == 1
|
||||
{
|
||||
txt % (multiple ? VLC->generaltexth->allTexts[42] : defender->unitType()->getNameSingularTranslated()); // creature perishes
|
||||
}
|
||||
MetaString line;
|
||||
line.appendRawString(txt.str());
|
||||
blm.lines.push_back(std::move(line));
|
||||
|
||||
if (killed > 1)
|
||||
{
|
||||
line.appendTextID("core.genrltxt.379"); // %d %s perished
|
||||
line.replaceNumber(killed);
|
||||
}
|
||||
else
|
||||
line.appendTextID("core.genrltxt.378"); // One %s perishes
|
||||
|
||||
if (multiple)
|
||||
{
|
||||
if (killed > 1)
|
||||
line.replaceTextID("core.genrltxt.43"); // creatures
|
||||
else
|
||||
line.replaceTextID("core.genrltxt.42"); // creature
|
||||
}
|
||||
else
|
||||
line.replaceName(CreatureID(defender->unitId()), killed);
|
||||
|
||||
blm.lines.push_back(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
void setObjPropertyValue(ObjectInstanceID objid, ObjProperty prop, int32_t value = 0) override {}
|
||||
void setObjPropertyID(ObjectInstanceID objid, ObjProperty prop, ObjPropertyID identifier) override {}
|
||||
void showInfoDialog(InfoWindow * iw) override {}
|
||||
void showInfoDialog(const std::string & msg, PlayerColor player) override {}
|
||||
|
||||
void changeSpells(const CGHeroInstance * hero, bool give, const std::set<SpellID> &spells) override {}
|
||||
bool removeObject(const CGObjectInstance * obj, const PlayerColor & initiator) override {return false;}
|
||||
|
Loading…
Reference in New Issue
Block a user