1
0
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:
Laserlicht 2023-11-25 03:14:31 +01:00 committed by GitHub
parent 1954447a9e
commit 2eada0efca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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), [&]()