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

- Rewrote Kingdom Overview window - all should be stable now

- New classes for GUI - lists and tabs
- finishing work on Json config in animations
This commit is contained in:
Ivan Savenko
2011-07-22 16:22:22 +00:00
parent f5874540b3
commit 35a528e062
9 changed files with 1940 additions and 1116 deletions

View File

@@ -4,6 +4,7 @@
#include "../CCallback.h"
#include "CCastleInterface.h"
#include "CCursorHandler.h"
#include "CKingdomInterface.h"
#include "CGameInfo.h"
#include "CHeroWindow.h"
#include "CMessage.h"
@@ -488,6 +489,15 @@ void CPlayerInterface::heroInGarrisonChange(const CGTownInstance *town)
c->garr->recreateSlots();
c->heroes->update();
}
BOOST_FOREACH(IShowActivable *isa, GH.listInt)
{
CKingdomInterface *ki = dynamic_cast<CKingdomInterface*>(isa);
if (ki)
{
ki->townChanged(town);
ki->updateGarrisons();
}
}
GH.totalRedraw();
}
void CPlayerInterface::heroVisitsTown(const CGHeroInstance* hero, const CGTownInstance * town)
@@ -1032,11 +1042,18 @@ void CPlayerInterface::heroArtifactSetChanged(const CGHeroInstance*hero)
void CPlayerInterface::availableCreaturesChanged( const CGDwelling *town )
{
boost::unique_lock<boost::recursive_mutex> un(*pim);
if(castleInt && town->ID == TOWNI_TYPE)
if(const CGTownInstance * townObj = dynamic_cast<const CGTownInstance*>(town))
{
CFortScreen *fs = dynamic_cast<CFortScreen*>(GH.topInt());
if(fs)
fs->creaturesChanged();
BOOST_FOREACH(IShowActivable *isa, GH.listInt)
{
CKingdomInterface *ki = dynamic_cast<CKingdomInterface*>(isa);
if (ki && townObj)
ki->townChanged(townObj);
}
}
else if(GH.listInt.size() && (town->ID == 17 || town->ID == 20 || town->ID == 106)) //external dwelling
{