From a5cfa8a04978e7de82aee4ff1795ed16d759990a Mon Sep 17 00:00:00 2001 From: Digmaster Date: Thu, 29 May 2014 01:52:41 -0400 Subject: [PATCH] Removes add behavior when pressing escape while waiting. --- apps/openmw/mwgui/waitdialog.cpp | 3 ++- apps/openmw/mwgui/windowbase.cpp | 5 +++++ apps/openmw/mwgui/windowbase.hpp | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index 460663682..9c7757af9 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -71,7 +71,8 @@ namespace MWGui void WaitDialog::exit() { - MWBase::Environment::get().getWindowManager()->popGuiMode(); + if(!mProgressBar.isVisible()) //Only exit if not currently waiting + MWBase::Environment::get().getWindowManager()->popGuiMode(); } void WaitDialog::open() diff --git a/apps/openmw/mwgui/windowbase.cpp b/apps/openmw/mwgui/windowbase.cpp index c2515a6de..cc18e6694 100644 --- a/apps/openmw/mwgui/windowbase.cpp +++ b/apps/openmw/mwgui/windowbase.cpp @@ -23,6 +23,11 @@ void WindowBase::setVisible(bool visible) close(); } +bool WindowBase::isVisible() +{ + return mMainWidget->getVisible(); +} + void WindowBase::center() { // Centre dialog diff --git a/apps/openmw/mwgui/windowbase.hpp b/apps/openmw/mwgui/windowbase.hpp index 471d8ac70..81073d419 100644 --- a/apps/openmw/mwgui/windowbase.hpp +++ b/apps/openmw/mwgui/windowbase.hpp @@ -29,6 +29,8 @@ namespace MWGui virtual void exit() {} ///Sets the visibility of the window virtual void setVisible(bool visible); + ///Returns the visibility state of the window + virtual bool isVisible(); void center(); /** Event : Dialog finished, OK button clicked.\n