1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Restored previously disabled University code, add interface to notify

market-like objects
This commit is contained in:
Ivan Savenko
2024-06-05 13:24:36 +00:00
parent c1ebb6b0e3
commit fcafe53da9
6 changed files with 70 additions and 43 deletions

View File

@ -442,18 +442,20 @@ void CPlayerInterface::heroPrimarySkillChanged(const CGHeroInstance * hero, Prim
EVENT_HANDLER_CALLED_BY_CLIENT;
if (which == PrimarySkill::EXPERIENCE)
{
for(auto ctw : GH.windows().findWindows<CMarketWindow>())
ctw->updateHero();
for(auto ctw : GH.windows().findWindows<IMarketHolder>())
ctw->updateExperience();
}
else
{
adventureInt->onHeroChanged(hero);
}
}
void CPlayerInterface::heroSecondarySkillChanged(const CGHeroInstance * hero, int which, int val)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
for (auto cuw : GH.windows().findWindows<CUniversityWindow>())
cuw->redraw();
for (auto cuw : GH.windows().findWindows<IMarketHolder>())
cuw->updateSecondarySkills();
}
void CPlayerInterface::heroManaPointsChanged(const CGHeroInstance * hero)
@ -472,8 +474,8 @@ void CPlayerInterface::heroMovePointsChanged(const CGHeroInstance * hero)
void CPlayerInterface::receivedResource()
{
EVENT_HANDLER_CALLED_BY_CLIENT;
for (auto mw : GH.windows().findWindows<CMarketWindow>())
mw->updateResource();
for (auto mw : GH.windows().findWindows<IMarketHolder>())
mw->updateResources();
GH.windows().totalRedraw();
}
@ -1675,7 +1677,7 @@ void CPlayerInterface::showHillFortWindow(const CGObjectInstance *object, const
void CPlayerInterface::availableArtifactsChanged(const CGBlackMarket * bm)
{
EVENT_HANDLER_CALLED_BY_CLIENT;
for (auto cmw : GH.windows().findWindows<CMarketWindow>())
for (auto cmw : GH.windows().findWindows<IMarketHolder>())
cmw->updateArtifacts();
}