Add warning when trying to open a dialog while the previous one is still visible

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12381 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2013-01-17 22:43:18 +00:00
parent ec48b69f9d
commit bf62dfa7de

View File

@ -23,6 +23,7 @@
#include "guiengine/widget.hpp"
#include "input/input_manager.hpp"
#include "io/file_manager.hpp"
#include "utils/log.hpp"
#include <IGUIEnvironment.h>
@ -119,7 +120,11 @@ void ModalDialog::doInit(const float percentWidth, const float percentHeight)
assert(false);
}
if (modalWindow != NULL) delete modalWindow;
if (modalWindow != NULL)
{
delete modalWindow;
Log::warn("GUIEngine", "Showing a modal dialog while the previous one is still open. Destroying the previous dialog.");
}
modalWindow = this;
m_irrlicht_window = GUIEngine::getGUIEnv()->addWindow(m_area, true /* modal */);