diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 2e4f140ae..416af822b 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -181,6 +181,11 @@ void CPlayerInterface::playerStartsTurn(PlayerColor player) GH.windows().pushWindow(adventureInt); } + //close window from another player + if(auto w = GH.windows().topWindow()) + if(w->ID == -1 && player != playerID) + w->close(); + // remove all dialogs that do not expect query answer while (!GH.windows().topWindow() && !GH.windows().topWindow()) GH.windows().popWindows(1); diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index 5d8a3f53a..2807aa413 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -142,7 +142,7 @@ class WindowBase : public CIntObject public: WindowBase(int used_ = 0, Point pos_ = Point()); protected: - void close(); + virtual void close(); }; class IGarrisonHolder diff --git a/client/windows/InfoWindows.h b/client/windows/InfoWindows.h index e7911884a..501c47459 100644 --- a/client/windows/InfoWindows.h +++ b/client/windows/InfoWindows.h @@ -55,7 +55,7 @@ public: std::vector> 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 createInfoWin(Point position, const CGObjectInstance * specific);