1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-04 04:45:35 +00:00

Clear message boxes in windowmanager cleanup (Fixes #1496)

This commit is contained in:
scrawl 2014-06-14 21:52:54 +02:00
parent e288437885
commit 9e6d21d95b
3 changed files with 21 additions and 0 deletions

View file

@ -25,6 +25,23 @@ namespace MWGui
}
}
void MessageBoxManager::clear()
{
delete mInterMessageBoxe;
mInterMessageBoxe = NULL;
std::vector<MessageBox*>::iterator it(mMessageBoxes.begin());
for (; it != mMessageBoxes.end(); ++it)
{
if (*it == mStaticMessageBox)
mStaticMessageBox = NULL;
delete *it;
}
mMessageBoxes.clear();
mLastButtonPressed = -1;
}
void MessageBoxManager::onFrame (float frameDuration)
{
std::vector<MessageBox*>::iterator it;

View file

@ -30,6 +30,9 @@ namespace MWGui
bool createInteractiveMessageBox (const std::string& message, const std::vector<std::string>& buttons);
bool isInteractiveMessageBox ();
/// Remove all message boxes
void clear();
bool removeMessageBox (MessageBox *msgbox);
void setMessageBoxSpeed (int speed);

View file

@ -1502,6 +1502,7 @@ namespace MWGui
{
mMap->clear();
mQuickKeysMenu->clear();
mMessageBoxManager->clear();
mTrainingWindow->resetReference();
mDialogueWindow->resetReference();