1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Close window at time expiring

This commit is contained in:
nordsoft 2023-08-14 15:37:21 +04:00
parent 23aaa72dfe
commit e426924930
3 changed files with 8 additions and 3 deletions

View File

@ -181,6 +181,11 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player)
GH.windows().pushWindow(adventureInt);
}
//close window from another player
if(auto w = GH.windows().topWindow<CInfoWindow>())
if(w->ID == -1 && player != playerID)
w->close();
// remove all dialogs that do not expect query answer
while (!GH.windows().topWindow<AdventureMapInterface>() && !GH.windows().topWindow<CInfoWindow>())
GH.windows().popWindows(1);

View File

@ -142,7 +142,7 @@ class WindowBase : public CIntObject
public:
WindowBase(int used_ = 0, Point pos_ = Point());
protected:
void close();
virtual void close();
};
class IGarrisonHolder

View File

@ -55,7 +55,7 @@ public:
std::vector<std::shared_ptr<CButton>> buttons;
TCompsInfo components;
virtual void close();
void close() override;
void show(Canvas & to) override;
void showAll(Canvas & to) override;
@ -78,7 +78,7 @@ public:
class CRClickPopup : public WindowBase
{
public:
virtual void close();
void close() override;
bool isPopupWindow() const override;
static std::shared_ptr<WindowBase> createInfoWin(Point position, const CGObjectInstance * specific);