mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Renamed MetaString methods to more logical names
This commit is contained in:
@@ -167,8 +167,8 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
|
||||
InfoWindow iw;
|
||||
iw.type = EInfoWindowMode::AUTO;
|
||||
iw.player = h->tempOwner;
|
||||
iw.text.addTxt(MetaString::ADVOB_TXT, 44); //{%s} \n\n The camp is deserted. Perhaps you should try next week.
|
||||
iw.text.addReplacement(MetaString::OBJ_NAMES, ID);
|
||||
iw.text.appendLocalString(EMetaText::ADVOB_TXT, 44); //{%s} \n\n The camp is deserted. Perhaps you should try next week.
|
||||
iw.text.replaceLocalString(EMetaText::OBJ_NAMES, ID);
|
||||
cb->sendAndApply(&iw);
|
||||
return;
|
||||
}
|
||||
@@ -182,13 +182,13 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
|
||||
{
|
||||
BlockingDialog bd(true,false);
|
||||
bd.player = h->tempOwner;
|
||||
bd.text.addTxt(MetaString::GENERAL_TXT, 421); //Much to your dismay, the %s is guarded by %s %s. Do you wish to fight the guards?
|
||||
bd.text.addReplacement(ID == Obj::CREATURE_GENERATOR1 ? MetaString::CREGENS : MetaString::CREGENS4, subID);
|
||||
bd.text.appendLocalString(EMetaText::GENERAL_TXT, 421); //Much to your dismay, the %s is guarded by %s %s. Do you wish to fight the guards?
|
||||
bd.text.replaceLocalString(ID == Obj::CREATURE_GENERATOR1 ? EMetaText::CREGENS : EMetaText::CREGENS4, subID);
|
||||
if(settings["gameTweaks"]["numericCreaturesQuantities"].Bool())
|
||||
bd.text.addReplacement(CCreature::getQuantityRangeStringForId(Slots().begin()->second->getQuantityID()));
|
||||
bd.text.replaceRawString(CCreature::getQuantityRangeStringForId(Slots().begin()->second->getQuantityID()));
|
||||
else
|
||||
bd.text.addReplacement(MetaString::ARRAY_TXT, 173 + (int)Slots().begin()->second->getQuantityID()*3);
|
||||
bd.text.addReplacement(*Slots().begin()->second);
|
||||
bd.text.replaceLocalString(EMetaText::ARRAY_TXT, 173 + (int)Slots().begin()->second->getQuantityID()*3);
|
||||
bd.text.replaceCreatureName(*Slots().begin()->second);
|
||||
cb->showBlockingDialog(&bd);
|
||||
return;
|
||||
}
|
||||
@@ -203,20 +203,20 @@ void CGDwelling::onHeroVisit( const CGHeroInstance * h ) const
|
||||
bd.player = h->tempOwner;
|
||||
if(ID == Obj::CREATURE_GENERATOR1 || ID == Obj::CREATURE_GENERATOR4)
|
||||
{
|
||||
bd.text.addTxt(MetaString::ADVOB_TXT, ID == Obj::CREATURE_GENERATOR1 ? 35 : 36); //{%s} Would you like to recruit %s? / {%s} Would you like to recruit %s, %s, %s, or %s?
|
||||
bd.text.addReplacement(ID == Obj::CREATURE_GENERATOR1 ? MetaString::CREGENS : MetaString::CREGENS4, subID);
|
||||
bd.text.appendLocalString(EMetaText::ADVOB_TXT, ID == Obj::CREATURE_GENERATOR1 ? 35 : 36); //{%s} Would you like to recruit %s? / {%s} Would you like to recruit %s, %s, %s, or %s?
|
||||
bd.text.replaceLocalString(ID == Obj::CREATURE_GENERATOR1 ? EMetaText::CREGENS : EMetaText::CREGENS4, subID);
|
||||
for(const auto & elem : creatures)
|
||||
bd.text.addReplacement(MetaString::CRE_PL_NAMES, elem.second[0]);
|
||||
bd.text.replaceLocalString(EMetaText::CRE_PL_NAMES, elem.second[0]);
|
||||
}
|
||||
else if(ID == Obj::REFUGEE_CAMP)
|
||||
{
|
||||
bd.text.addTxt(MetaString::ADVOB_TXT, 35); //{%s} Would you like to recruit %s?
|
||||
bd.text.addReplacement(MetaString::OBJ_NAMES, ID);
|
||||
bd.text.appendLocalString(EMetaText::ADVOB_TXT, 35); //{%s} Would you like to recruit %s?
|
||||
bd.text.replaceLocalString(EMetaText::OBJ_NAMES, ID);
|
||||
for(const auto & elem : creatures)
|
||||
bd.text.addReplacement(MetaString::CRE_PL_NAMES, elem.second[0]);
|
||||
bd.text.replaceLocalString(EMetaText::CRE_PL_NAMES, elem.second[0]);
|
||||
}
|
||||
else if(ID == Obj::WAR_MACHINE_FACTORY)
|
||||
bd.text.addTxt(MetaString::ADVOB_TXT, 157); //{War Machine Factory} Would you like to purchase War Machines?
|
||||
bd.text.appendLocalString(EMetaText::ADVOB_TXT, 157); //{War Machine Factory} Would you like to purchase War Machines?
|
||||
else
|
||||
throw std::runtime_error("Illegal dwelling!");
|
||||
|
||||
@@ -330,8 +330,8 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
|
||||
InfoWindow iw;
|
||||
iw.type = EInfoWindowMode::AUTO;
|
||||
iw.player = h->tempOwner;
|
||||
iw.text.addTxt(MetaString::GENERAL_TXT, 425);//The %s would join your hero, but there aren't enough provisions to support them.
|
||||
iw.text.addReplacement(MetaString::CRE_PL_NAMES, crid);
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 425);//The %s would join your hero, but there aren't enough provisions to support them.
|
||||
iw.text.replaceLocalString(EMetaText::CRE_PL_NAMES, crid);
|
||||
cb->showInfoDialog(&iw);
|
||||
}
|
||||
else //give creatures
|
||||
@@ -345,9 +345,9 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
|
||||
InfoWindow iw;
|
||||
iw.type = EInfoWindowMode::AUTO;
|
||||
iw.player = h->tempOwner;
|
||||
iw.text.addTxt(MetaString::GENERAL_TXT, 423); //%d %s join your army.
|
||||
iw.text.addReplacement(count);
|
||||
iw.text.addReplacement(MetaString::CRE_PL_NAMES, crid);
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 423); //%d %s join your army.
|
||||
iw.text.replaceNumber(count);
|
||||
iw.text.replaceLocalString(EMetaText::CRE_PL_NAMES, crid);
|
||||
|
||||
cb->showInfoDialog(&iw);
|
||||
cb->sendAndApply(&sac);
|
||||
@@ -358,8 +358,8 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.type = EInfoWindowMode::AUTO;
|
||||
iw.text.addTxt(MetaString::GENERAL_TXT, 422); //There are no %s here to recruit.
|
||||
iw.text.addReplacement(MetaString::CRE_PL_NAMES, crid);
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 422); //There are no %s here to recruit.
|
||||
iw.text.replaceLocalString(EMetaText::CRE_PL_NAMES, crid);
|
||||
iw.player = h->tempOwner;
|
||||
cb->sendAndApply(&iw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user