mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
town now updates
This commit is contained in:
parent
b89cdda718
commit
c96cc405ed
@ -591,6 +591,9 @@ void CPlayerInterface::buildChanged(const CGTownInstance *town, BuildingID build
|
||||
// Perform totalRedraw in order to force redraw of updated town list icon from adventure map
|
||||
GH.windows().totalRedraw();
|
||||
}
|
||||
|
||||
for (auto cgh : GH.windows().findWindows<ITownHolder>())
|
||||
cgh->buildChanged(town);
|
||||
}
|
||||
|
||||
void CPlayerInterface::battleStartBefore(const BattleID & battleID, const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2)
|
||||
|
@ -153,6 +153,12 @@ public:
|
||||
virtual void updateGarrisons() = 0;
|
||||
};
|
||||
|
||||
class ITownHolder
|
||||
{
|
||||
public:
|
||||
virtual void buildChanged() = 0;
|
||||
};
|
||||
|
||||
class IStatusBar
|
||||
{
|
||||
public:
|
||||
|
@ -640,6 +640,11 @@ void CKingdomInterface::activateTab(size_t which)
|
||||
tabArea->setActive(which);
|
||||
}
|
||||
|
||||
void CKingdomInterface::buildChanged()
|
||||
{
|
||||
tabArea->reset();
|
||||
}
|
||||
|
||||
void CKingdomInterface::townChanged(const CGTownInstance *town)
|
||||
{
|
||||
if(auto townList = std::dynamic_pointer_cast<CKingdTownList>(tabArea->getItem()))
|
||||
|
@ -200,7 +200,7 @@ public:
|
||||
};
|
||||
|
||||
/// Class which holds all parts of kingdom overview window
|
||||
class CKingdomInterface : public CWindowObject, public IGarrisonHolder, public CArtifactHolder
|
||||
class CKingdomInterface : public CWindowObject, public IGarrisonHolder, public CArtifactHolder, public ITownHolder
|
||||
{
|
||||
private:
|
||||
struct OwnedObjectInfo
|
||||
@ -257,6 +257,7 @@ public:
|
||||
void artifactMoved(const ArtifactLocation &artLoc, const ArtifactLocation &destLoc, bool withRedraw) override;
|
||||
void artifactDisassembled(const ArtifactLocation &artLoc) override;
|
||||
void artifactAssembled(const ArtifactLocation &artLoc) override;
|
||||
void buildChanged() override;
|
||||
};
|
||||
|
||||
/// List item with town
|
||||
|
Loading…
Reference in New Issue
Block a user