|
@@ -17,7 +17,6 @@
|
|
|
#include "QuickRecruitmentWindow.h"
|
|
|
#include "CCreatureWindow.h"
|
|
|
|
|
|
-#include "../CGameInfo.h"
|
|
|
#include "../CPlayerInterface.h"
|
|
|
#include "../GameEngine.h"
|
|
|
#include "../PlayerLocalState.h"
|
|
@@ -250,7 +249,7 @@ std::string CBuildingRect::getSubtitle()//hover text for building
|
|
|
if(availableCreatures.size())
|
|
|
{
|
|
|
int creaID = availableCreatures.back();//taking last of available creatures
|
|
|
- return CGI->generaltexth->allTexts[16] + " " + CGI->creh->objects.at(creaID)->getNamePluralTranslated();
|
|
|
+ return VLC->generaltexth->allTexts[16] + " " + VLC->creh->objects.at(creaID)->getNamePluralTranslated();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -288,8 +287,8 @@ CDwellingInfoBox::CDwellingInfoBox(int centerX, int centerY, const CGTownInstanc
|
|
|
animation = std::make_shared<CCreaturePic>(30, 44, creature, true, true);
|
|
|
|
|
|
std::string text = std::to_string(Town->creatures.at(level).first);
|
|
|
- available = std::make_shared<CLabel>(80,190, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[217] + text);
|
|
|
- costPerTroop = std::make_shared<CLabel>(80, 227, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->allTexts[346]);
|
|
|
+ available = std::make_shared<CLabel>(80,190, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[217] + text);
|
|
|
+ costPerTroop = std::make_shared<CLabel>(80, 227, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->allTexts[346]);
|
|
|
|
|
|
for(int i = 0; i<GameConstants::RESOURCE_QUANTITY; i++)
|
|
|
{
|
|
@@ -392,7 +391,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
|
|
|
auto upgradeAll = [upgradableSlots, obj](){
|
|
|
if(!upgradableSlots.canAffordAny)
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townWindow.upgradeAll.notUpgradable"));
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.townWindow.upgradeAll.notUpgradable"));
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -405,7 +404,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
|
|
|
|
|
|
std::string textID = upgradableSlots.canAffordAll ? "core.genrltxt.207" : "vcmi.townWindow.upgradeAll.notAllUpgradable";
|
|
|
|
|
|
- LOCPLINT->showYesNoDialog(CGI->generaltexth->translate(textID), [upgradableSlots, obj](){
|
|
|
+ LOCPLINT->showYesNoDialog(VLC->generaltexth->translate(textID), [upgradableSlots, obj](){
|
|
|
for(auto & upgradeInfo : upgradableSlots.upgradeInfos)
|
|
|
LOCPLINT->cb->upgradeCreature(obj, upgradeInfo.first, upgradeInfo.second.getUpgrade());
|
|
|
}, nullptr, resComps);
|
|
@@ -441,7 +440,7 @@ void CHeroGSlot::gesture(bool on, const Point & initialPosition, const Point & f
|
|
|
{ RadialMenuConfig::ITEM_SE, twoHeroes, "swapArtifacts", "vcmi.radialWheel.heroSwapArtifacts", [heroId, heroOtherId](){CExchangeController(heroId, heroOtherId).swapArtifacts(true, true);} }
|
|
|
};
|
|
|
RadialMenuConfig upgradeSlot = { RadialMenuConfig::ITEM_WW, true, "upgradeCreatures", "vcmi.radialWheel.upgradeCreatures", [upgradeAll](){ upgradeAll(); } };
|
|
|
- RadialMenuConfig dismissSlot = { RadialMenuConfig::ITEM_WW, true, "dismissHero", "vcmi.radialWheel.heroDismiss", [this](){ LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr); } };
|
|
|
+ RadialMenuConfig dismissSlot = { RadialMenuConfig::ITEM_WW, true, "dismissHero", "vcmi.radialWheel.heroDismiss", [this](){ LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[22], [=](){ LOCPLINT->cb->dismissHero(hero); }, nullptr); } };
|
|
|
|
|
|
if(upgradableSlots.isCreatureUpgradePossible)
|
|
|
menuElements.push_back(upgradeSlot);
|
|
@@ -464,12 +463,12 @@ void CHeroGSlot::hover(bool on)
|
|
|
{
|
|
|
if(isSelected())//view NNN
|
|
|
{
|
|
|
- temp = CGI->generaltexth->tcommands[4];
|
|
|
+ temp = VLC->generaltexth->tcommands[4];
|
|
|
boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
|
|
|
}
|
|
|
else if(other->hero && other->isSelected())//exchange
|
|
|
{
|
|
|
- temp = CGI->generaltexth->tcommands[7];
|
|
|
+ temp = VLC->generaltexth->tcommands[7];
|
|
|
boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
|
|
|
boost::algorithm::replace_first(temp,"%s",other->hero->getNameTranslated());
|
|
|
}
|
|
@@ -477,12 +476,12 @@ void CHeroGSlot::hover(bool on)
|
|
|
{
|
|
|
if(upg)//down - visiting
|
|
|
{
|
|
|
- temp = CGI->generaltexth->tcommands[32];
|
|
|
+ temp = VLC->generaltexth->tcommands[32];
|
|
|
boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
|
|
|
}
|
|
|
else //up - garrison
|
|
|
{
|
|
|
- temp = CGI->generaltexth->tcommands[12];
|
|
|
+ temp = VLC->generaltexth->tcommands[12];
|
|
|
boost::algorithm::replace_first(temp,"%s",hero->getNameTranslated());
|
|
|
}
|
|
|
}
|
|
@@ -491,12 +490,12 @@ void CHeroGSlot::hover(bool on)
|
|
|
{
|
|
|
if(other->isSelected() && other->hero) //move NNNN
|
|
|
{
|
|
|
- temp = CGI->generaltexth->tcommands[6];
|
|
|
+ temp = VLC->generaltexth->tcommands[6];
|
|
|
boost::algorithm::replace_first(temp,"%s",other->hero->getNameTranslated());
|
|
|
}
|
|
|
else //empty
|
|
|
{
|
|
|
- temp = CGI->generaltexth->allTexts[507];
|
|
|
+ temp = VLC->generaltexth->allTexts[507];
|
|
|
}
|
|
|
}
|
|
|
if(temp.size())
|
|
@@ -614,7 +613,7 @@ void HeroSlots::swapArmies()
|
|
|
{
|
|
|
if (!town->visitingHero && LOCPLINT->cb->howManyHeroes(false) >= LOCPLINT->cb->getSettings().getInteger(EGameSettings::HEROES_PER_PLAYER_ON_MAP_CAP))
|
|
|
{
|
|
|
- std::string text = CGI->generaltexth->translate("core.genrltxt.18"); //You already have %d adventuring heroes under your command.
|
|
|
+ std::string text = VLC->generaltexth->translate("core.genrltxt.18"); //You already have %d adventuring heroes under your command.
|
|
|
boost::algorithm::replace_first(text,"%d",std::to_string(LOCPLINT->cb->howManyHeroes(false)));
|
|
|
|
|
|
LOCPLINT->showInfoDialog(text, std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
|
@@ -623,7 +622,7 @@ void HeroSlots::swapArmies()
|
|
|
else if (town->garrisonHero->stacksCount() == 0)
|
|
|
{
|
|
|
//This hero has no creatures. A hero must have creatures before he can brave the dangers of the countryside.
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("core.genrltxt.19"), {}, soundBase::sound_todo);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("core.genrltxt.19"), {}, soundBase::sound_todo);
|
|
|
allow = false;
|
|
|
}
|
|
|
}
|
|
@@ -632,7 +631,7 @@ void HeroSlots::swapArmies()
|
|
|
{
|
|
|
if(!town->visitingHero->canBeMergedWith(*town))
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[275], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[275], std::vector<std::shared_ptr<CComponent>>(), soundBase::sound_todo);
|
|
|
allow = false;
|
|
|
}
|
|
|
}
|
|
@@ -870,7 +869,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|
|
if(getHero())
|
|
|
ENGINE->windows().createAndPushWindow<CMarketWindow>(town, getHero(), nullptr, *b->marketModes.begin());
|
|
|
else
|
|
|
- LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
|
|
|
+ LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[273]) % b->getNameTranslated())); //Only visiting heroes may use the %s.
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -910,7 +909,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|
|
}
|
|
|
else if(town->shipyardStatus() == IBoatGenerator::BOAT_ALREADY_BUILT)
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[51]);
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -929,7 +928,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|
|
return true;
|
|
|
|
|
|
case BuildingID::SHIP:
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[51]); //Cannot build another boat
|
|
|
return true;
|
|
|
|
|
|
case BuildingID::SPECIAL_1:
|
|
@@ -952,7 +951,7 @@ bool CCastleBuildings::buildingTryActivateCustomUI(BuildingID buildingToTest, Bu
|
|
|
|
|
|
case BuildingSubID::PORTAL_OF_SUMMONING:
|
|
|
if (town->creatures[town->getTown()->creatures.size()].second.empty())//No creatures
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->tcommands[30]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->tcommands[30]);
|
|
|
else
|
|
|
enterDwelling(town->getTown()->creatures.size());
|
|
|
return true;
|
|
@@ -999,7 +998,7 @@ void CCastleBuildings::enterBlacksmith(BuildingID building, ArtifactID artifactI
|
|
|
const CGHeroInstance *hero = town->visitingHero;
|
|
|
if(!hero)
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(boost::str(boost::format(CGI->generaltexth->allTexts[273]) % town->getTown()->buildings.find(building)->second->getNameTranslated()));
|
|
|
+ LOCPLINT->showInfoDialog(boost::str(boost::format(VLC->generaltexth->allTexts[273]) % town->getTown()->buildings.find(building)->second->getNameTranslated()));
|
|
|
return;
|
|
|
}
|
|
|
auto art = artifactID.toArtifact();
|
|
@@ -1036,7 +1035,7 @@ void CCastleBuildings::enterCastleGate(BuildingID building)
|
|
|
{
|
|
|
if (!town->visitingHero)
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[126]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[126]);
|
|
|
return;//only visiting hero can use castle gates
|
|
|
}
|
|
|
std::vector <int> availableTowns;
|
|
@@ -1060,8 +1059,8 @@ void CCastleBuildings::enterCastleGate(BuildingID building)
|
|
|
}
|
|
|
|
|
|
auto gateIcon = std::make_shared<CAnimImage>(town->getTown()->clientInfo.buildingsIcons, building);//will be deleted by selection window
|
|
|
- auto wnd = std::make_shared<CObjectListWindow>(availableTowns, gateIcon, CGI->generaltexth->jktexts[40],
|
|
|
- CGI->generaltexth->jktexts[41], std::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1), 0, images);
|
|
|
+ auto wnd = std::make_shared<CObjectListWindow>(availableTowns, gateIcon, VLC->generaltexth->jktexts[40],
|
|
|
+ VLC->generaltexth->jktexts[41], std::bind (&CCastleInterface::castleTeleport, LOCPLINT->castleInt, _1), 0, images);
|
|
|
wnd->onPopup = [availableTowns](int index) { CRClickPopup::createAndPush(LOCPLINT->cb->getObjInstance(ObjectInstanceID(availableTowns[index])), ENGINE->getCursorPosition()); };
|
|
|
ENGINE->windows().pushWindow(wnd);
|
|
|
}
|
|
@@ -1093,7 +1092,7 @@ void CCastleBuildings::enterToTheQuickRecruitmentWindow()
|
|
|
if(hasSomeoneToRecruit)
|
|
|
ENGINE->windows().createAndPushWindow<QuickRecruitmentWindow>(town, pos);
|
|
|
else
|
|
|
- CInfoWindow::showInfoDialog(CGI->generaltexth->translate("vcmi.townHall.noCreaturesToRecruit"), {});
|
|
|
+ CInfoWindow::showInfoDialog(VLC->generaltexth->translate("vcmi.townHall.noCreaturesToRecruit"), {});
|
|
|
}
|
|
|
|
|
|
void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID::EBuildingSubID subID, BuildingID upgrades)
|
|
@@ -1103,8 +1102,8 @@ void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID:
|
|
|
std::string hasNotProduced;
|
|
|
std::string hasProduced;
|
|
|
|
|
|
- hasNotProduced = CGI->generaltexth->allTexts[677];
|
|
|
- hasProduced = CGI->generaltexth->allTexts[678];
|
|
|
+ hasNotProduced = VLC->generaltexth->allTexts[677];
|
|
|
+ hasProduced = VLC->generaltexth->allTexts[678];
|
|
|
|
|
|
bool isMysticPondOrItsUpgrade = subID == BuildingSubID::MYSTIC_POND
|
|
|
|| (upgrades != BuildingID::NONE
|
|
@@ -1120,7 +1119,7 @@ void CCastleBuildings::enterFountain(const BuildingID & building, BuildingSubID:
|
|
|
else //Mystic Pond produced something;
|
|
|
{
|
|
|
descr += "\n\n" + hasProduced;
|
|
|
- boost::algorithm::replace_first(descr,"%s",CGI->generaltexth->restypes[town->bonusValue.first]);
|
|
|
+ boost::algorithm::replace_first(descr,"%s",VLC->generaltexth->restypes[town->bonusValue.first]);
|
|
|
boost::algorithm::replace_first(descr,"%d",std::to_string(town->bonusValue.second));
|
|
|
}
|
|
|
}
|
|
@@ -1138,12 +1137,12 @@ void CCastleBuildings::enterMagesGuild()
|
|
|
if(hero->isCampaignYog())
|
|
|
{
|
|
|
// "Yog has given up magic in all its forms..."
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[736]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[736]);
|
|
|
}
|
|
|
else if(LOCPLINT->cb->getResourceAmount(EGameResID::GOLD) < 500) //not enough gold to buy spellbook
|
|
|
{
|
|
|
openMagesGuild();
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[213]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[213]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1152,7 +1151,7 @@ void CCastleBuildings::enterMagesGuild()
|
|
|
onYes += [hero](){ LOCPLINT->cb->buyArtifact(hero, ArtifactID::SPELLBOOK); };
|
|
|
std::vector<std::shared_ptr<CComponent>> components(1, std::make_shared<CComponent>(ComponentType::ARTIFACT, ArtifactID(ArtifactID::SPELLBOOK)));
|
|
|
|
|
|
- LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[214], onYes, onNo, components);
|
|
|
+ LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[214], onYes, onNo, components);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -1168,13 +1167,13 @@ void CCastleBuildings::enterTownHall()
|
|
|
{
|
|
|
if(!vstd::contains(town->forbiddenBuildings, BuildingID::GRAIL))
|
|
|
{
|
|
|
- LOCPLINT->showYesNoDialog(CGI->generaltexth->allTexts[597], //Do you wish this to be the permanent home of the Grail?
|
|
|
+ LOCPLINT->showYesNoDialog(VLC->generaltexth->allTexts[597], //Do you wish this to be the permanent home of the Grail?
|
|
|
[&](){ LOCPLINT->cb->buildBuilding(town, BuildingID::GRAIL); },
|
|
|
[&](){ openTownHall(); });
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[673]);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->allTexts[673]);
|
|
|
assert(ENGINE->windows().topWindow<CInfoWindow>() != nullptr);
|
|
|
ENGINE->windows().topWindow<CInfoWindow>()->buttons[0]->addCallback(std::bind(&CCastleBuildings::openTownHall, this));
|
|
|
}
|
|
@@ -1207,7 +1206,7 @@ void CCastleBuildings::enterAnyThievesGuild()
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithTavern"));
|
|
|
}
|
|
|
|
|
|
void CCastleBuildings::enterBank(BuildingID building)
|
|
@@ -1216,12 +1215,12 @@ void CCastleBuildings::enterBank(BuildingID building)
|
|
|
if(town->bonusValue.second > 0)
|
|
|
{
|
|
|
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE_PER_DAY, GameResID(GameResID::GOLD), -500));
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.townStructure.bank.payBack"), components);
|
|
|
}
|
|
|
else{
|
|
|
|
|
|
components.push_back(std::make_shared<CComponent>(ComponentType::RESOURCE, GameResID(GameResID::GOLD), 2500));
|
|
|
- LOCPLINT->showYesNoDialog(CGI->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this, building](){ LOCPLINT->cb->visitTownBuilding(town, building); }, nullptr, components);
|
|
|
+ LOCPLINT->showYesNoDialog(VLC->generaltexth->translate("vcmi.townStructure.bank.borrow"), [this, building](){ LOCPLINT->cb->visitTownBuilding(town, building); }, nullptr, components);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1242,7 +1241,7 @@ void CCastleBuildings::enterAnyMarket()
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
|
|
|
}
|
|
|
|
|
|
CCreaInfo::CCreaInfo(Point position, const CGTownInstance * Town, int Level, bool compact, bool _showAvailable):
|
|
@@ -1429,10 +1428,10 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
|
|
|
income = std::make_shared<CLabel>(195, 443, FONT_SMALL, ETextAlignment::CENTER);
|
|
|
icon = std::make_shared<CAnimImage>(AnimationPath::builtin("ITPT"), 0, 0, 15, 387);
|
|
|
|
|
|
- exit = std::make_shared<CButton>(Point(744, 544), AnimationPath::builtin("TSBTNS"), CButton::tooltip(CGI->generaltexth->tcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
|
|
|
+ exit = std::make_shared<CButton>(Point(744, 544), AnimationPath::builtin("TSBTNS"), CButton::tooltip(VLC->generaltexth->tcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
|
|
|
exit->setImageOrder(4, 5, 6, 7);
|
|
|
|
|
|
- auto split = std::make_shared<CButton>(Point(744, 382), AnimationPath::builtin("TSBTNS"), CButton::tooltip(CGI->generaltexth->tcommands[3]), [this]() { garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
|
|
|
+ auto split = std::make_shared<CButton>(Point(744, 382), AnimationPath::builtin("TSBTNS"), CButton::tooltip(VLC->generaltexth->tcommands[3]), [this]() { garr->splitClick(); }, EShortcut::HERO_ARMY_SPLIT);
|
|
|
garr->addSplitBtn(split);
|
|
|
|
|
|
Rect barRect(9, 182, 732, 18);
|
|
@@ -1678,11 +1677,11 @@ void CHallInterface::CBuildingBox::hover(bool on)
|
|
|
{
|
|
|
std::string toPrint;
|
|
|
if(state==EBuildingState::PREREQUIRES || state == EBuildingState::MISSING_BASE)
|
|
|
- toPrint = CGI->generaltexth->hcommands[5];
|
|
|
+ toPrint = VLC->generaltexth->hcommands[5];
|
|
|
else if(state==EBuildingState::CANT_BUILD_TODAY)
|
|
|
- toPrint = CGI->generaltexth->allTexts[223];
|
|
|
+ toPrint = VLC->generaltexth->allTexts[223];
|
|
|
else
|
|
|
- toPrint = CGI->generaltexth->hcommands[static_cast<int>(state)];
|
|
|
+ toPrint = VLC->generaltexth->hcommands[static_cast<int>(state)];
|
|
|
boost::algorithm::replace_first(toPrint,"%s",building->getNameTranslated());
|
|
|
ENGINE->statusbar()->write(toPrint);
|
|
|
}
|
|
@@ -1716,7 +1715,7 @@ CHallInterface::CHallInterface(const CGTownInstance * Town):
|
|
|
statusbar = CGStatusBar::create(statusbarBackground);
|
|
|
|
|
|
title = std::make_shared<CLabel>(399, 12, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, town->getTown()->buildings.at(BuildingID(town->hallLevel()+BuildingID::VILLAGE_HALL))->getNameTranslated());
|
|
|
- exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(CGI->generaltexth->hcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
|
|
|
+ exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(VLC->generaltexth->hcommands[8]), [&](){close();}, EShortcut::GLOBAL_RETURN);
|
|
|
|
|
|
auto & boxList = town->getTown()->clientInfo.hallSlots;
|
|
|
boxes.resize(boxList.size());
|
|
@@ -1831,7 +1830,7 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
|
|
|
{
|
|
|
std::string ret;
|
|
|
if(state < EBuildingState::ALLOWED)
|
|
|
- ret = CGI->generaltexth->hcommands[static_cast<int>(state)];
|
|
|
+ ret = VLC->generaltexth->hcommands[static_cast<int>(state)];
|
|
|
switch (state)
|
|
|
{
|
|
|
case EBuildingState::ALREADY_PRESENT:
|
|
@@ -1840,7 +1839,7 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
|
|
|
ret.replace(ret.find_first_of("%s"), 2, building->getNameTranslated());
|
|
|
break;
|
|
|
case EBuildingState::ALLOWED:
|
|
|
- return CGI->generaltexth->allTexts[219]; //all prereq. are met
|
|
|
+ return VLC->generaltexth->allTexts[219]; //all prereq. are met
|
|
|
case EBuildingState::PREREQUIRES:
|
|
|
{
|
|
|
auto toStr = [&](const BuildingID build) -> std::string
|
|
@@ -1848,13 +1847,13 @@ std::string CBuildWindow::getTextForState(EBuildingState state)
|
|
|
return town->getTown()->buildings.at(build)->getNameTranslated();
|
|
|
};
|
|
|
|
|
|
- ret = CGI->generaltexth->allTexts[52];
|
|
|
+ ret = VLC->generaltexth->allTexts[52];
|
|
|
ret += "\n" + town->genBuildingRequirements(building->bid).toString(toStr);
|
|
|
break;
|
|
|
}
|
|
|
case EBuildingState::MISSING_BASE:
|
|
|
{
|
|
|
- std::string msg = CGI->generaltexth->translate("vcmi.townHall.missingBase");
|
|
|
+ std::string msg = VLC->generaltexth->translate("vcmi.townHall.missingBase");
|
|
|
ret = boost::str(boost::format(msg) % town->getTown()->buildings.at(building->upgrade)->getNameTranslated());
|
|
|
break;
|
|
|
}
|
|
@@ -1921,7 +1920,7 @@ CFortScreen::CFortScreen(const CGTownInstance * town):
|
|
|
const CBuilding * fortBuilding = town->getTown()->buildings.at(BuildingID(town->fortLevel()+6));
|
|
|
title = std::make_shared<CLabel>(400, 12, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE, fortBuilding->getNameTranslated());
|
|
|
|
|
|
- std::string text = boost::str(boost::format(CGI->generaltexth->fcommands[6]) % fortBuilding->getNameTranslated());
|
|
|
+ std::string text = boost::str(boost::format(VLC->generaltexth->fcommands[6]) % fortBuilding->getNameTranslated());
|
|
|
exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1"), CButton::tooltip(text), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
|
|
|
|
|
|
std::vector<Point> positions =
|
|
@@ -2018,29 +2017,29 @@ CFortScreen::RecruitArea::RecruitArea(int posX, int posY, const CGTownInstance *
|
|
|
if(town->hasBuilt(getMyBuilding()->bid))
|
|
|
{
|
|
|
ui32 available = town->creatures[level].first;
|
|
|
- std::string availableText = CGI->generaltexth->allTexts[217]+ std::to_string(available);
|
|
|
+ std::string availableText = VLC->generaltexth->allTexts[217]+ std::to_string(available);
|
|
|
availableCount = std::make_shared<CLabel>(78, 119, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, availableText);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if(getMyCreature() != nullptr)
|
|
|
{
|
|
|
- hoverText = boost::str(boost::format(CGI->generaltexth->tcommands[21]) % getMyCreature()->getNamePluralTranslated());
|
|
|
+ hoverText = boost::str(boost::format(VLC->generaltexth->tcommands[21]) % getMyCreature()->getNamePluralTranslated());
|
|
|
new CCreaturePic(159, 4, getMyCreature(), false);
|
|
|
new CLabel(78, 11, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, getMyCreature()->getNamePluralTranslated(), 152);
|
|
|
|
|
|
Rect sizes(287, 4, 96, 18);
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[190], CGI->generaltexth->fcommands[0], getMyCreature()->getAttack(false)));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[190], VLC->generaltexth->fcommands[0], getMyCreature()->getAttack(false)));
|
|
|
sizes.y+=20;
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[191], CGI->generaltexth->fcommands[1], getMyCreature()->getDefense(false)));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[191], VLC->generaltexth->fcommands[1], getMyCreature()->getDefense(false)));
|
|
|
sizes.y+=21;
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[199], CGI->generaltexth->fcommands[2], getMyCreature()->getMinDamage(false), getMyCreature()->getMaxDamage(false)));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[199], VLC->generaltexth->fcommands[2], getMyCreature()->getMinDamage(false), getMyCreature()->getMaxDamage(false)));
|
|
|
sizes.y+=20;
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[388], CGI->generaltexth->fcommands[3], getMyCreature()->getMaxHealth()));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[388], VLC->generaltexth->fcommands[3], getMyCreature()->getMaxHealth()));
|
|
|
sizes.y+=21;
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[193], CGI->generaltexth->fcommands[4], getMyCreature()->valOfBonuses(BonusType::STACKS_SPEED)));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[193], VLC->generaltexth->fcommands[4], getMyCreature()->valOfBonuses(BonusType::STACKS_SPEED)));
|
|
|
sizes.y+=20;
|
|
|
- values.push_back(std::make_shared<LabeledValue>(sizes, CGI->generaltexth->allTexts[194], CGI->generaltexth->fcommands[5], town->creatureGrowth(level)));
|
|
|
+ values.push_back(std::make_shared<LabeledValue>(sizes, VLC->generaltexth->allTexts[194], VLC->generaltexth->fcommands[5], town->creatureGrowth(level)));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2086,7 +2085,7 @@ void CFortScreen::RecruitArea::creaturesChangedEventHandler()
|
|
|
{
|
|
|
if(availableCount)
|
|
|
{
|
|
|
- std::string availableText = CGI->generaltexth->allTexts[217] + std::to_string(town->creatures[level].first);
|
|
|
+ std::string availableText = VLC->generaltexth->allTexts[217] + std::to_string(town->creatures[level].first);
|
|
|
availableCount->setText(availableText);
|
|
|
}
|
|
|
}
|
|
@@ -2117,7 +2116,7 @@ CMageGuildScreen::CMageGuildScreen(CCastleInterface * owner, const ImagePath & i
|
|
|
auto statusbarBackground = std::make_shared<CPicture>(background->getSurface(), barRect, 7, 556);
|
|
|
statusbar = CGStatusBar::create(statusbarBackground);
|
|
|
|
|
|
- exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(CGI->generaltexth->allTexts[593]), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
|
|
|
+ exit = std::make_shared<CButton>(Point(748, 556), AnimationPath::builtin("TPMAGE1.DEF"), CButton::tooltip(VLC->generaltexth->allTexts[593]), [&](){ close(); }, EShortcut::GLOBAL_RETURN);
|
|
|
|
|
|
updateSpells(townId);
|
|
|
}
|
|
@@ -2180,7 +2179,7 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
|
|
|
|
|
|
if(town->spellResearchCounterDay >= LOCPLINT->cb->getSettings().getValue(EGameSettings::TOWNS_SPELL_RESEARCH_PER_DAY).Vector()[level].Float())
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.comeAgain"));
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.spellResearch.comeAgain"));
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2193,7 +2192,7 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
|
|
|
int index = town->spellsAtLevel(level, false);
|
|
|
if (index >= town->spells[level].size())
|
|
|
{
|
|
|
- LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.noMoreSpells"));
|
|
|
+ LOCPLINT->showInfoDialog(VLC->generaltexth->translate("vcmi.spellResearch.noMoreSpells"));
|
|
|
return;
|
|
|
}
|
|
|
auto newSpell = town->spells[level].at(index);
|
|
@@ -2209,20 +2208,20 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition)
|
|
|
for(int i = 0; i < 3; i++)
|
|
|
pom.emplace_back(AnimationPath::builtin("settingsWindow/button80"), nullptr);
|
|
|
|
|
|
- auto text = CGI->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford");
|
|
|
+ auto text = VLC->generaltexth->translate(LOCPLINT->cb->getResourceAmount().canAfford(cost) ? "vcmi.spellResearch.pay" : "vcmi.spellResearch.canNotAfford");
|
|
|
boost::replace_first(text, "%SPELL1", spell->id.toSpell()->getNameTranslated());
|
|
|
boost::replace_first(text, "%SPELL2", newSpell.toSpell()->getNameTranslated());
|
|
|
auto temp = std::make_shared<CInfoWindow>(text, LOCPLINT->playerID, resComps, pom);
|
|
|
|
|
|
temp->buttons[0]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/accept")));
|
|
|
temp->buttons[0]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, true); });
|
|
|
- temp->buttons[0]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.research")); });
|
|
|
+ temp->buttons[0]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.research")); });
|
|
|
temp->buttons[0]->setEnabled(LOCPLINT->cb->getResourceAmount().canAfford(cost));
|
|
|
temp->buttons[1]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/reroll")));
|
|
|
temp->buttons[1]->addCallback([this, town](){ LOCPLINT->cb->spellResearch(town, spell->id, false); });
|
|
|
- temp->buttons[1]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.skip")); });
|
|
|
+ temp->buttons[1]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.skip")); });
|
|
|
temp->buttons[2]->setOverlay(std::make_shared<CPicture>(ImagePath::builtin("spellResearch/close")));
|
|
|
- temp->buttons[2]->addPopupCallback([](){ CRClickPopup::createAndPush(CGI->generaltexth->translate("vcmi.spellResearch.abort")); });
|
|
|
+ temp->buttons[2]->addPopupCallback([](){ CRClickPopup::createAndPush(VLC->generaltexth->translate("vcmi.spellResearch.abort")); });
|
|
|
|
|
|
ENGINE->windows().pushWindow(temp);
|
|
|
}
|
|
@@ -2273,10 +2272,10 @@ CBlacksmithDialog::CBlacksmithDialog(bool possible, CreatureID creMachineID, Art
|
|
|
cancelText.appendTextID("core.genrltxt.596");
|
|
|
cancelText.replaceTextID(creature->getNameSingularTextID());
|
|
|
|
|
|
- std::string costString = std::to_string(aid.toEntity(CGI)->getPrice());
|
|
|
+ std::string costString = std::to_string(aid.toEntity(VLC)->getPrice());
|
|
|
|
|
|
title = std::make_shared<CLabel>(165, 28, FONT_BIG, ETextAlignment::CENTER, Colors::YELLOW, titleString.toString());
|
|
|
- costText = std::make_shared<CLabel>(165, 218, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->jktexts[43]);
|
|
|
+ costText = std::make_shared<CLabel>(165, 218, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, VLC->generaltexth->jktexts[43]);
|
|
|
costValue = std::make_shared<CLabel>(165, 292, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, costString);
|
|
|
buy = std::make_shared<CButton>(Point(42, 312), AnimationPath::builtin("IBUY30.DEF"), CButton::tooltip(buyText.toString()), [&](){ close(); }, EShortcut::GLOBAL_ACCEPT);
|
|
|
cancel = std::make_shared<CButton>(Point(224, 312), AnimationPath::builtin("ICANCEL.DEF"), CButton::tooltip(cancelText.toString()), [&](){ close(); }, EShortcut::GLOBAL_CANCEL);
|