|
|
@@ -1329,20 +1329,26 @@ void CCastleInterface::recreateIcons()
|
|
|
fort = std::make_shared<CTownInfo>(122, 413, town, false);
|
|
|
|
|
|
fastTownHall = std::make_shared<CButton>(Point(80, 413), AnimationPath::builtin("ITMTL.def"), CButton::tooltip(), [&](){ builds->enterTownHall(); });
|
|
|
- fastTownHall->setImageOrder(town->hallLevel() - 1, town->hallLevel() - 1, town->hallLevel() - 1, town->hallLevel() - 1);
|
|
|
+ fastTownHall->setImageOrder(town->hallLevel(), town->hallLevel(), town->hallLevel(), town->hallLevel());
|
|
|
fastTownHall->setAnimateLonelyFrame(true);
|
|
|
|
|
|
+ int imageIndex = town->fortLevel() == CGTownInstance::EFortLevel::NONE ? 3 : town->fortLevel() - 1;
|
|
|
fastArmyPurchase = std::make_shared<CButton>(Point(122, 413), AnimationPath::builtin("itmcl.def"), CButton::tooltip(), [&](){ builds->enterToTheQuickRecruitmentWindow(); });
|
|
|
- fastArmyPurchase->setImageOrder(town->fortLevel() - 1, town->fortLevel() - 1, town->fortLevel() - 1, town->fortLevel() - 1);
|
|
|
+ fastArmyPurchase->setImageOrder(imageIndex, imageIndex, imageIndex, imageIndex);
|
|
|
fastArmyPurchase->setAnimateLonelyFrame(true);
|
|
|
|
|
|
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), [&]()
|