mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
allow shortcout if any town has a marketplace
This commit is contained in:
parent
1954447a9e
commit
2eada0efca
@ -1339,11 +1339,16 @@ void CCastleInterface::recreateIcons()
|
||||
|
||||
fastMarket = std::make_shared<LRClickableArea>(Rect(163, 410, 64, 42), [&]()
|
||||
{
|
||||
if(town->builtBuildings.count(BuildingID::MARKETPLACE))
|
||||
std::vector<const CGTownInstance*> towns = LOCPLINT->cb->getTownsInfo(true);
|
||||
for(auto & town : towns)
|
||||
{
|
||||
if (town->getOwner() == LOCPLINT->playerID)
|
||||
GH.windows().createAndPushWindow<CMarketplaceWindow>(town, town->visitingHero, nullptr, EMarketMode::RESOURCE_RESOURCE);
|
||||
if(town->builtBuildings.count(BuildingID::MARKETPLACE))
|
||||
{
|
||||
GH.windows().createAndPushWindow<CMarketplaceWindow>(town, nullptr, nullptr, EMarketMode::RESOURCE_RESOURCE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.adventureMap.noTownWithMarket"));
|
||||
});
|
||||
|
||||
fastTavern = std::make_shared<LRClickableArea>(Rect(15, 387, 58, 64), [&]()
|
||||
|
Loading…
x
Reference in New Issue
Block a user