1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Mod system improvement: Patch 2

This commit is contained in:
Dmitry Orlov
2020-10-25 01:04:34 +03:00
parent 3cb0dfb143
commit d6a4767865
8 changed files with 104 additions and 20 deletions

View File

@@ -1269,7 +1269,18 @@ CUniversityWindow::CUniversityWindow(const CGHeroInstance * _hero, const IMarket
bars->preload();
if(market->o->ID == Obj::TOWN)
titlePic = std::make_shared<CAnimImage>(CGI->townh->factions[ETownType::CONFLUX]->town->clientInfo.buildingsIcons, BuildingID::MAGIC_UNIVERSITY);
{
auto town = dynamic_cast<const CGTownInstance *>(_market);
if(town)
{
auto faction = town->town->faction->index;
auto bid = town->town->getSpecialBuilding(BuildingSubID::MAGIC_UNIVERSITY)->bid;
titlePic = std::make_shared<CAnimImage>(CGI->townh->factions[faction]->town->clientInfo.buildingsIcons, bid);
}
else
titlePic = std::make_shared<CAnimImage>(CGI->townh->factions[ETownType::CONFLUX]->town->clientInfo.buildingsIcons, BuildingID::MAGIC_UNIVERSITY);
}
else
titlePic = std::make_shared<CPicture>("UNIVBLDG");